From patchwork Thu Aug 20 11:17:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 7043761 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9376FC05AC for ; Thu, 20 Aug 2015 11:17:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C21A3205CD for ; Thu, 20 Aug 2015 11:17:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 03F28205CB for ; Thu, 20 Aug 2015 11:17:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751863AbbHTLRo (ORCPT ); Thu, 20 Aug 2015 07:17:44 -0400 Received: from mail-yk0-f181.google.com ([209.85.160.181]:33935 "EHLO mail-yk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751844AbbHTLRn (ORCPT ); Thu, 20 Aug 2015 07:17:43 -0400 Received: by ykdt205 with SMTP id t205so33876222ykd.1 for ; Thu, 20 Aug 2015 04:17:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=V6QsNYOBE7SxQmJ9NsJkwXwZsBdwWr4ELxDroKlAN1o=; b=cb/eV6z9JmBu9mKfdbL1kaUCVyulSw3BBMo53/md+EBJPIaDSxugX8mC6OUJwtOeEQ 2VdS6dIwFSU0yL/+W730r/Iwl8eKiSJrPj+f2aHMEJIhBr+y2Oc+uQMlMw1XKSmWYTs0 rBAAyrVlSaRNucCgmwU/+khh+KSiFhzAWDhcS7ht7A2GQl1xXt6/yJ13Fgjnh4v5xXLM k8AMs77YBM9zbe24dn372NfbunPIyB/65LRiWLHEBhVtzQexJMkXLoaZt9t+8Txw91+8 TD07Jtv925hjbIeS3E0jUoDoyR55vSFpkVPZzDwdxidgb6qS2ZkRGr/1iEE6Brg7X0GN 3W6A== X-Gm-Message-State: ALoCoQmkmALiapUlfWSP8GYatr/uTu53FtjECrHEqQMeyFCX0zZnU04UBtLZmev75CSu5GpyBaLd X-Received: by 10.170.36.66 with SMTP id 63mr2466416yke.31.1440069462946; Thu, 20 Aug 2015 04:17:42 -0700 (PDT) Received: from tlielax.poochiereds.net (cpe-45-37-211-243.nc.res.rr.com. [45.37.211.243]) by smtp.googlemail.com with ESMTPSA id k66sm3637319ywe.0.2015.08.20.04.17.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2015 04:17:42 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, hch@lst.de, kinglongmee@gmail.com Subject: [PATCH v3 17/20] nfsd: have nfsd_test_lock use the nfsd_file cache Date: Thu, 20 Aug 2015 07:17:17 -0400 Message-Id: <1440069440-27454-18-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1440069440-27454-1-git-send-email-jeff.layton@primarydata.com> References: <1440069440-27454-1-git-send-email-jeff.layton@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jeff Layton --- fs/nfsd/nfs4state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 9e390b9fb33e..a92faba3a847 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5542,11 +5542,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; }