Lines Matching refs:dsi
90 list_for_each_entry(struct diskstat_info, dsi, &gdiskstat_list, list) { in find_dsi_by_name()
91 if (dsi->mode != mode) in find_dsi_by_name()
93 if (strcasecmp(dsi->name, n) == 0) in find_dsi_by_name()
94 return dsi; in find_dsi_by_name()
125 struct diskstat_info *dsi = gr->query_data; in query_dsi_load() local
128 if (dsi->last_time) { in query_dsi_load()
129 if (dsi->last_time + gr->pane->period <= now) { in query_dsi_load()
131 if (get_file_values(dsi->sysfs_filename, &stat) < 0) in query_dsi_load()
135 switch (dsi->mode) { in query_dsi_load()
139 dsi->last_stat.r_sectors) * 512) / in query_dsi_load()
145 dsi->last_stat.w_sectors) * 512) / in query_dsi_load()
151 dsi->last_stat = stat; in query_dsi_load()
152 dsi->last_time = now; in query_dsi_load()
157 switch (dsi->mode) { in query_dsi_load()
160 get_file_values(dsi->sysfs_filename, &dsi->last_stat); in query_dsi_load()
163 dsi->last_time = now; in query_dsi_load()
178 struct diskstat_info *dsi; in hud_diskstat_graph_install() local
184 dsi = find_dsi_by_name(dev_name, mode); in hud_diskstat_graph_install()
185 if (!dsi) in hud_diskstat_graph_install()
192 dsi->mode = mode; in hud_diskstat_graph_install()
193 if (dsi->mode == DISKSTAT_RD) { in hud_diskstat_graph_install()
194 snprintf(gr->name, sizeof(gr->name), "%s-Read-MB/s", dsi->name); in hud_diskstat_graph_install()
196 else if (dsi->mode == DISKSTAT_WR) { in hud_diskstat_graph_install()
197 snprintf(gr->name, sizeof(gr->name), "%s-Write-MB/s", dsi->name); in hud_diskstat_graph_install()
202 gr->query_data = dsi; in hud_diskstat_graph_install()
212 struct diskstat_info *dsi = CALLOC_STRUCT(diskstat_info); in add_object_part() local
214 strcpy(dsi->name, name); in add_object_part()
215 snprintf(dsi->sysfs_filename, sizeof(dsi->sysfs_filename), "%s/%s/stat", in add_object_part()
217 dsi->mode = objmode; in add_object_part()
218 list_addtail(&dsi->list, &gdiskstat_list); in add_object_part()
225 struct diskstat_info *dsi = CALLOC_STRUCT(diskstat_info); in add_object() local
227 strcpy(dsi->name, name); in add_object()
228 snprintf(dsi->sysfs_filename, sizeof(dsi->sysfs_filename), "%s/stat", in add_object()
230 dsi->mode = objmode; in add_object()
231 list_addtail(&dsi->list, &gdiskstat_list); in add_object()
314 list_for_each_entry(struct diskstat_info, dsi, &gdiskstat_list, list) { in hud_get_num_disks()
317 dsi->mode == DISKSTAT_RD ? "rd" : in hud_get_num_disks()
318 dsi->mode == DISKSTAT_WR ? "wr" : "undefined", dsi->name); in hud_get_num_disks()