summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs3-helpers.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2012-02-14 14:48:43 +0530
committerAnand Avati <avati@redhat.com>2012-02-14 02:58:15 -0800
commitcd3ad588f206a902027e6045e15c55380f33998d (patch)
tree84b3e56c9b801b953b495483bce221a6fb25ad87 /xlators/nfs/server/src/nfs3-helpers.c
parentfa580e9299e09562c395bd464f3a1cf8a1116d6e (diff)
nfs/server: Add counters for hard resolutionv3.2.6qa3
Change-Id: Id7b26731b750b63d645222dde18cd9fe4ed54018 BUG: 785314 Signed-off-by: Vijay Bellur <vijay@gluster.com> Reviewed-on: http://review.gluster.com/2745 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src/nfs3-helpers.c')
-rw-r--r--xlators/nfs/server/src/nfs3-helpers.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c
index 1c4f69fad22..e59d3ba7601 100644
--- a/xlators/nfs/server/src/nfs3-helpers.c
+++ b/xlators/nfs/server/src/nfs3-helpers.c
@@ -2909,8 +2909,9 @@ err:
int
nfs3_fh_resolve_inode_hard (nfs3_call_state_t *cs)
{
- int ret = -EFAULT;
- nfs_user_t nfu = {0, };
+ int ret = -EFAULT;
+ nfs_user_t nfu = {0, };
+ struct nfs_state *nfs = NULL;
if (!cs)
return ret;
@@ -2929,6 +2930,16 @@ nfs3_fh_resolve_inode_hard (nfs3_call_state_t *cs)
", hashcount: %d, current hashidx %d",
uuid_utoa (cs->resolvefh.gfid),
cs->resolvefh.hashcount, cs->hashidx);
+
+ nfs = THIS->private;
+
+ LOCK (&nfs->lock);
+ {
+ nfs->res_stat.ino_cnt++;
+ nfs->res_stat.intvl_ino_cnt++;
+ }
+ UNLOCK (&nfs->lock);
+
ret = nfs_root_loc_fill (cs->vol->itable, &cs->resolvedloc);
if (ret == 0) {
@@ -2951,8 +2962,9 @@ out:
int
nfs3_fh_resolve_entry_hard (nfs3_call_state_t *cs)
{
- int ret = -EFAULT;
- nfs_user_t nfu = {0, };
+ int ret = -EFAULT;
+ nfs_user_t nfu = {0, };
+ struct nfs_state *nfs = NULL;
if (!cs)
return ret;
@@ -2962,6 +2974,14 @@ nfs3_fh_resolve_entry_hard (nfs3_call_state_t *cs)
gf_log (GF_NFS3, GF_LOG_TRACE, "FH hard resolution: gfid: %s "
", entry: %s, hashidx: %d", uuid_utoa (cs->resolvefh.gfid),
cs->resolventry, cs->hashidx);
+ nfs = THIS->private;
+
+ LOCK (&nfs->lock);
+ {
+ nfs->res_stat.entry_cnt++;
+ nfs->res_stat.intvl_entry_cnt++;
+ }
+ UNLOCK (&nfs->lock);
ret = nfs_entry_loc_fill (cs->vol->itable, cs->resolvefh.gfid,
cs->resolventry, &cs->resolvedloc,