summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2014-07-10 20:07:27 +0200
committerJ. Bruce Fields <bfields@redhat.com>2014-07-10 21:05:26 +0200
commite20fcf1e6586ff1620adc345ad2a93d5ee5def59 (patch)
treeb34b7459d45443731931c3f2e58580fe8b2b0521
parentnfsd: Add locking to the nfs4_file->fi_fds[] array (diff)
downloadlinux-e20fcf1e6586ff1620adc345ad2a93d5ee5def59.tar.xz
linux-e20fcf1e6586ff1620adc345ad2a93d5ee5def59.zip
nfsd: clean up helper __release_lock_stateid
Use filp_close instead of open coding. filp_close does a bit more than just release the locks and put the filp. It also calls ->flush and dnotify_flush, both of which should be done here anyway. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Jeff Layton <jlayton@primarydata.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4state.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 314dc8061461..4ab567e7db0f 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -821,10 +821,8 @@ static void __release_lock_stateid(struct nfs4_ol_stateid *stp)
unhash_generic_stateid(stp);
unhash_stid(&stp->st_stid);
file = find_any_file(stp->st_file);
- if (file) {
- locks_remove_posix(file, (fl_owner_t)lockowner(stp->st_stateowner));
- fput(file);
- }
+ if (file)
+ filp_close(file, (fl_owner_t)lockowner(stp->st_stateowner));
close_generic_stateid(stp);
free_generic_stateid(stp);
}