summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2014-07-09 15:03:16 +0530
committerVijay Bellur <vbellur@redhat.com>2014-07-18 04:43:37 -0700
commitc7f617dfe63fea23693c9ae74b8761349d17a986 (patch)
treee57a894ac4da1437bed381cef781679c4e678b48 /xlators
parentd7c725f4ac8d0c20855f5ca1e4c2dcdddf422057 (diff)
features/gfid-access: Print real-gfid in statedump
Change-Id: I1cac8f3ccfcf1fda64ff8470d4f2000d05dcab63 BUG: 1117733 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8271 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/gfid-access/src/gfid-access.c24
1 files changed, 24 insertions, 0 deletions
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} },