]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nfsd: have nfsd_test_lock use the nfsd_file cache
authorJeff Layton <jeff.layton@primarydata.com>
Sun, 18 Aug 2019 18:18:55 +0000 (14:18 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 19 Aug 2019 15:09:09 +0000 (11:09 -0400)
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c

index 17b1ad4a619f8f960e57fb0c4f9a65258abe3e55..906e214dcce8d226d5bf37fe68fcffd8131dd82d 100644 (file)
@@ -6605,11 +6605,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;
 }