summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-02-22 14:38:42 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-22 09:42:25 -0800
commitca502ca780202c71623a34349c88d114ad58ec12 (patch)
tree6345e2c230a3396fb8fb10e435c6176063e83051 /cli/src/cli-rpc-ops.c
parent1350aecc7e600e73b810522c7727be20bdd3ae40 (diff)
cli: print the type of the inode in gluster volume status inode output
Instead of a number print the type of the inode in the output of gluster volume status inode. This is what the output symbols indicate. R -----> Regular file D -----> Directory L -----> symbolic Link B -----> Block special device C -----> Character special device F -----> FIFO S -----> Socket I -----> Invalid inode type Also supress a warning message displayed at the time of build. Change-Id: I5a2adfe044ce21d9da159652d4b6e25cd0a2fdca BUG: 796078 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/2794 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 9537c977d12..5dfdbe063f5 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -4360,6 +4360,7 @@ cli_print_volume_status_inode_entry (dict_t *dict, char *prefix)
uint64_t nlookup = 0;
uint32_t ref = 0;
int ia_type = 0;
+ char inode_type;
GF_ASSERT (dict);
GF_ASSERT (prefix);
@@ -4388,8 +4389,35 @@ cli_print_volume_status_inode_entry (dict_t *dict, char *prefix)
if (ret)
goto out;
- cli_out ("%-40s %14"PRIu64" %14"PRIu32" %9d",
- gfid, nlookup, ref, ia_type);
+ switch (ia_type) {
+ case IA_IFREG:
+ inode_type = 'R';
+ break;
+ case IA_IFDIR:
+ inode_type = 'D';
+ break;
+ case IA_IFLNK:
+ inode_type = 'L';
+ break;
+ case IA_IFBLK:
+ inode_type = 'B';
+ break;
+ case IA_IFCHR:
+ inode_type = 'C';
+ break;
+ case IA_IFIFO:
+ inode_type = 'F';
+ break;
+ case IA_IFSOCK:
+ inode_type = 'S';
+ break;
+ default:
+ inode_type = 'I';
+ break;
+ }
+
+ cli_out ("%-40s %14"PRIu64" %14"PRIu32" %9c",
+ gfid, nlookup, ref, inode_type);
out:
return;
@@ -5346,7 +5374,7 @@ cmd_heal_volume_brick_out (dict_t *dict, int brick)
ret = dict_get_str (dict, key, &path);
if (ret)
continue;
- cli_out (path);
+ cli_out ("%s", path);
}
out:
return;