From 928395eddf4241433effc55e294a7996108da7d8 Mon Sep 17 00:00:00 2001 From: Xie Changlong Date: Mon, 3 Jun 2019 15:59:38 +0800 Subject: gnfs: support inode dump So, we will get more debug info. fixes: #679 Change-Id: I3588e204ad25c20b69271c1a4ee17d0d158bd794 Signed-off-by: Xie Changlong --- xlators/nfs/server/src/nfs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'xlators') diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index ebded415c38..aef88acc37b 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -31,6 +31,7 @@ #include #include "rpcsvc.h" #include "nfs-messages.h" +#include "glusterfs/statedump.h" #define OPT_SERVER_AUX_GIDS "nfs.server-aux-gids" #define OPT_SERVER_GID_CACHE_TIMEOUT "nfs.server.aux-gid-timeout" @@ -1667,6 +1668,20 @@ out: return ret; } +int32_t +nfs_itable_dump(xlator_t *this) +{ + if (!this) + return -1; + + if (this->next && this->next->itable) { + gf_proc_dump_add_section("xlator.nfs.itable"); + inode_table_dump(this->next->itable, "xlator.nfs.itable"); + } + + return 0; +} + struct xlator_cbks cbks = { .forget = nfs_forget, }; @@ -1676,6 +1691,7 @@ struct xlator_fops fops; struct xlator_dumpops dumpops = { .priv = nfs_priv, .priv_to_dict = nfs_priv_to_dict, + .inode = nfs_itable_dump, }; /* TODO: If needed, per-volume options below can be extended to be export -- cgit