From c7f617dfe63fea23693c9ae74b8761349d17a986 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 9 Jul 2014 15:03:16 +0530 Subject: features/gfid-access: Print real-gfid in statedump Change-Id: I1cac8f3ccfcf1fda64ff8470d4f2000d05dcab63 BUG: 1117733 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/8271 Tested-by: Gluster Build System Reviewed-by: Kotresh HR Reviewed-by: Vijay Bellur --- xlators/features/gfid-access/src/gfid-access.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'xlators/features/gfid-access/src/gfid-access.c') diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c index a5869f82187..399780d616d 100644 --- a/xlators/features/gfid-access/src/gfid-access.c +++ b/xlators/features/gfid-access/src/gfid-access.c @@ -15,6 +15,7 @@ #include "gfid-access.h" #include "inode.h" #include "byte-order.h" +#include "statedump.h" int @@ -1381,6 +1382,25 @@ fini (xlator_t *this) return; } +int32_t +ga_dump_inodectx (xlator_t *this, inode_t *inode) +{ + int ret = -1; + uint64_t value = 0; + inode_t *tmp_inode = NULL; + char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0, }; + + ret = inode_ctx_get (inode, this, &value); + if (ret == 0) { + tmp_inode = (void*) value; + gf_proc_dump_build_key (key_prefix, this->name, "inode"); + gf_proc_dump_add_section (key_prefix); + gf_proc_dump_write ("real-gfid", "%s", + uuid_utoa (tmp_inode->gfid)); + } + + return 0; +} struct xlator_fops fops = { .lookup = ga_lookup, @@ -1410,6 +1430,10 @@ struct xlator_cbks cbks = { .forget = ga_forget, }; +struct xlator_dumpops dumpops = { + .inodectx = ga_dump_inodectx, +}; + struct volume_options options[] = { /* This translator doesn't take any options, or provide any options */ { .key = {NULL} }, -- cgit