dht: Modified dht-statedump to print all subvolume_status
Change-Id: I1aae33472bd15fc2bd7a170544f2994534fdf246 BUG: 1058204 Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com> Reviewed-on: http://review.gluster.org/6800 Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
parent
7ee0275333
commit
408d50a64b
@ -103,20 +103,20 @@ dht_priv_dump (xlator_t *this)
|
||||
this->name);
|
||||
gf_proc_dump_write("subvol_cnt","%d", conf->subvolume_cnt);
|
||||
for (i = 0; i < conf->subvolume_cnt; i++) {
|
||||
sprintf (key, "subvolumes[%d]", i);
|
||||
snprintf (key, sizeof (key), "subvolumes[%d]", i);
|
||||
gf_proc_dump_write(key, "%s.%s", conf->subvolumes[i]->type,
|
||||
conf->subvolumes[i]->name);
|
||||
if (conf->file_layouts && conf->file_layouts[i]){
|
||||
sprintf (key, "file_layouts[%d]", i);
|
||||
snprintf (key, sizeof (key), "file_layouts[%d]", i);
|
||||
dht_layout_dump(conf->file_layouts[i], key);
|
||||
}
|
||||
if (conf->dir_layouts && conf->dir_layouts[i]) {
|
||||
sprintf (key, "dir_layouts[%d]", i);
|
||||
snprintf (key, sizeof (key), "dir_layouts[%d]", i);
|
||||
dht_layout_dump(conf->dir_layouts[i], key);
|
||||
}
|
||||
if (conf->subvolume_status) {
|
||||
|
||||
sprintf (key, "subvolume_status[%d]", i);
|
||||
snprintf (key, sizeof (key), "subvolume_status[%d]", i);
|
||||
gf_proc_dump_write(key, "%d",
|
||||
(int)conf->subvolume_status[i]);
|
||||
}
|
||||
@ -130,14 +130,35 @@ dht_priv_dump (xlator_t *this)
|
||||
gf_proc_dump_write("disk_unit", "%c", conf->disk_unit);
|
||||
gf_proc_dump_write("refresh_interval", "%d", conf->refresh_interval);
|
||||
gf_proc_dump_write("unhashed_sticky_bit", "%d", conf->unhashed_sticky_bit);
|
||||
if (conf ->du_stats) {
|
||||
gf_proc_dump_write("du_stats.avail_percent", "%lf",
|
||||
conf->du_stats->avail_percent);
|
||||
gf_proc_dump_write("du_stats.avail_space", "%lu",
|
||||
conf->du_stats->avail_space);
|
||||
gf_proc_dump_write("du_stats.avail_inodes", "%lf",
|
||||
conf->du_stats->avail_inodes);
|
||||
gf_proc_dump_write("du_stats.log", "%lu", conf->du_stats->log);
|
||||
|
||||
if (conf->du_stats) {
|
||||
for (i = 0; i < conf->subvolume_cnt; i++) {
|
||||
if (!conf->subvolume_status[i])
|
||||
continue;
|
||||
|
||||
snprintf (key, sizeof (key), "subvolumes[%d]", i);
|
||||
gf_proc_dump_write (key, "%s",
|
||||
conf->subvolumes[i]->name);
|
||||
|
||||
snprintf (key, sizeof (key),
|
||||
"du_stats[%d].avail_percent", i);
|
||||
gf_proc_dump_write (key, "%lf",
|
||||
conf->du_stats[i].avail_percent);
|
||||
|
||||
snprintf (key, sizeof (key), "du_stats[%d].avail_space",
|
||||
i);
|
||||
gf_proc_dump_write (key, "%lu",
|
||||
conf->du_stats[i].avail_space);
|
||||
|
||||
snprintf (key, sizeof (key),
|
||||
"du_stats[%d].avail_inodes", i);
|
||||
gf_proc_dump_write (key, "%lf",
|
||||
conf->du_stats[i].avail_inodes);
|
||||
|
||||
snprintf (key, sizeof (key), "du_stats[%d].log", i);
|
||||
gf_proc_dump_write (key, "%lu",
|
||||
conf->du_stats[i].log);
|
||||
}
|
||||
}
|
||||
|
||||
if (conf->last_stat_fetch.tv_sec)
|
||||
|
Loading…
x
Reference in New Issue
Block a user