diff options
Diffstat (limited to 'xlators/nfs/server')
-rw-r--r-- | xlators/nfs/server/src/nfs3-helpers.c | 2 | ||||
-rw-r--r-- | xlators/nfs/server/src/nfs3.c | 17 |
2 files changed, 5 insertions, 14 deletions
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c index cff029d6e72..8e4ca372027 100644 --- a/xlators/nfs/server/src/nfs3-helpers.c +++ b/xlators/nfs/server/src/nfs3-helpers.c @@ -1775,7 +1775,7 @@ nfs3_dir_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto err; } - cs->fd = fd_ref (fd); + cs->fd = fd; /* Gets unrefd when the call state is wiped. */ nfs3_set_inode_opened (cs->nfsx, cs->resolvedloc.inode); gf_log (GF_NFS3, GF_LOG_TRACE, "FD_REF: %d", fd->refcount); nfs3_call_resume (cs); diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 7fed84d5021..ce59275202e 100644 --- a/xlators/nfs/server/src/nfs3.c +++ b/xlators/nfs/server/src/nfs3.c @@ -3889,17 +3889,6 @@ nfs3svc_readdir_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, stat = NFS3_OK; nfs3err: - - /* On end-of-directory, unref the fd to have it removed from the cache - * and also unbind it from the fd so that any subsequent request on the - * on the directory do not get this fd when fd_lookup is called in - * dir open resume path. - */ - if (is_eof) { - gf_log (GF_NFS3, GF_LOG_TRACE, "EOF REF: %d", cs->fd->refcount); - fd_unref_unbind (cs->fd); - } - if (cs->maxcount == 0) { nfs3_log_readdir_res (nfs_rpcsvc_request_xid (cs->req), stat, op_errno, (uintptr_t)cs->fd, @@ -3917,7 +3906,10 @@ nfs3err: cs->maxcount, is_eof); } - gf_log (GF_NFS3, GF_LOG_TRACE, "CS WIPE REF: %d", cs->fd->refcount); + if (is_eof) { + /* do nothing */ + } + nfs3_call_state_wipe (cs); return 0; } @@ -3968,7 +3960,6 @@ err: * so that next time the dir is read, we'll get any changed directory * entries. */ - fd_unref_unbind (cs->fd); nfs3_call_state_wipe (cs); ret: return 0; |