From: Jeff Layton Date: Tue, 20 Oct 2015 17:33:49 +0000 (-0400) Subject: nfsd: have nfsd_test_lock use the nfsd_file cache X-Git-Tag: KARO-TX6UL-2015-11-03~110^2~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0bc457cfd094d409af0e753fb3180861552910f0;p=karo-tx-linux.git nfsd: have nfsd_test_lock use the nfsd_file cache Signed-off-by: Jeff Layton Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index d5df685d4291..a7665acfde01 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5605,11 +5605,11 @@ out: */ static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock) { - struct file *file; - __be32 err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file); + struct nfsd_file *nf; + __be32 err = nfsd_file_acquire(rqstp, fhp, NFSD_MAY_READ, &nf); if (!err) { - err = nfserrno(vfs_test_lock(file, lock)); - fput(file); + err = nfserrno(vfs_test_lock(nf->nf_file, lock)); + nfsd_file_put(nf); } return err; }