]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
nfsd: have nfsd_test_lock use the nfsd_file cache
authorJeff Layton <jlayton@poochiereds.net>
Tue, 20 Oct 2015 17:33:49 +0000 (13:33 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 23 Oct 2015 19:57:43 +0000 (15:57 -0400)
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c

index d5df685d42912bace0eeab6d8444dcbdbf613263..a7665acfde010de628bf438c1edcbc0b6df6a35c 100644 (file)
@@ -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;
 }