diff options
author | Xavier Hernandez <xhernandez@datalab.es> | 2017-01-10 11:21:06 +0100 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2017-01-19 15:52:26 -0800 |
commit | 7b5b7111c9d9a2a65e4f4d0abf832a88e021c576 (patch) | |
tree | d14a9363adb120a5d1f3ca018c2041e7f97a3983 /cli/src/cli-cmd-volume.c | |
parent | 4e11d50f3f803e685c844da1f168a633c3834fd0 (diff) | |
download | glusterfs-7b5b7111c9d9a2a65e4f4d0abf832a88e021c576.tar.gz glusterfs-7b5b7111c9d9a2a65e4f4d0abf832a88e021c576.tar.xz glusterfs-7b5b7111c9d9a2a65e4f4d0abf832a88e021c576.zip |
cli: keep 'gluster volume status detail' consistent
The output of the command 'gluster volume status <volname> detail' is
not consistent between operating systems. On linux hosts it shows the
file system type, the device name, mount options and inode size of each
brick. However the same command executed on a FreeBSD host doesn't show
all this information, even for bricks stored on a linux.
Additionally, for hosts other than linux, this information is shown as
'N/A' many times. This has been fixed to show as much information as it
can be retrieved from the operating system.
The file contrib/mount/mntent.c has been mostly rewriten because it
contained many errors that caused mount information to not be retrieved
on some operating systems.
Change-Id: Icb6e19e8af6ec82255e7792ad71914ef679fc316
BUG: 1411334
Signed-off-by: Xavier Hernandez <xhernandez@datalab.es>
Reviewed-on: http://review.gluster.org/16371
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r-- | cli/src/cli-cmd-volume.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 5068d34c48..dbf1e3e232 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -2584,13 +2584,11 @@ cli_get_detail_status (dict_t *dict, int i, cli_volume_status_t *status) if (!status->total) goto out; -#ifdef GF_LINUX_HOST_OS memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "brick%d.device", i); ret = dict_get_str (dict, key, &(status->device)); if (ret) status->device = NULL; -#endif memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "brick%d.block_size", i); @@ -2600,7 +2598,6 @@ cli_get_detail_status (dict_t *dict, int i, cli_volume_status_t *status) status->block_size = 0; } -#ifdef GF_LINUX_HOST_OS memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "brick%d.mnt_options", i); ret = dict_get_str (dict, key, &(status->mount_options)); @@ -2620,7 +2617,6 @@ cli_get_detail_status (dict_t *dict, int i, cli_volume_status_t *status) ret = dict_get_str (dict, key, &(status->inode_size)); if (ret) status->inode_size = NULL; -#endif /* GF_LINUX_HOST_OS */ memset (key, 0, sizeof (key)); snprintf (key, sizeof (key), "brick%d.total_inodes", i); @@ -2658,7 +2654,6 @@ cli_print_detailed_status (cli_volume_status_t *status) cli_out ("%-20s : %-20c", "Online", (status->online) ? 'Y' : 'N'); cli_out ("%-20s : %-20s", "Pid", status->pid_str); -#ifdef GF_LINUX_HOST_OS if (status->fs_name) cli_out ("%-20s : %-20s", "File System", status->fs_name); else @@ -2682,7 +2677,6 @@ cli_print_detailed_status (cli_volume_status_t *status) } else { cli_out ("%-20s : %-20s", "Inode Size", "N/A"); } -#endif if (status->free) cli_out ("%-20s : %-20s", "Disk Space Free", status->free); else |