From patchwork Mon Oct 5 11:02:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 7326371 Return-Path: X-Original-To: patchwork-linux-fsdevel@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 E4384BEEA4 for ; Mon, 5 Oct 2015 11:03:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0DA09206E9 for ; Mon, 5 Oct 2015 11:03:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30AF2206EB for ; Mon, 5 Oct 2015 11:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751864AbbJELDI (ORCPT ); Mon, 5 Oct 2015 07:03:08 -0400 Received: from mail-qg0-f50.google.com ([209.85.192.50]:35750 "EHLO mail-qg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbbJELDF (ORCPT ); Mon, 5 Oct 2015 07:03:05 -0400 Received: by qgt47 with SMTP id 47so145709008qgt.2 for ; Mon, 05 Oct 2015 04:03:04 -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=aW5bLwMeaBs9hgzxg5PCP0V8fLubRTO5ivzaOsO6mv8=; b=GxI6z/ADcSjNjjkYnOuQX6uMFvutYC6SDlV1n+rinUKcStMM4zc6Qgd/cSm1yHs3lW a+wlXQpRQQYX4krxo2A6vcLXKXoiuaaNpGaP0gU/IE1+t9Cb5kBpTGH+S+ShZOBsVFkg Gb4GFQgHZ/5MhtxdDwb77tSTukuT1KIXtx6raTTr8QRc7Jdzt+EW4drw5pjEYFrcbjVM 8Nm+HU9iHbYQZM6zjyKOGJShdwrtJQ0502EGOojt8lx939e6hK0bf2sgvclwPiiiNPAM ZRSBn4LP3dvVt4xUnpQC05sOBBvvpORVLgdEex4UgHOEKb/A8wfY1ye5ZqxyIgNh2o/T uNDA== X-Gm-Message-State: ALoCoQn/UnvQuhR0QHg7Ax6hOtMJzl/Zr7aSfgMEPT5/fT/IxzKjmVt08SgRVqrbxq7xPyuJW59H X-Received: by 10.140.104.179 with SMTP id a48mr37619688qgf.42.1444042984831; Mon, 05 Oct 2015 04:03:04 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:6079::d5a]) by smtp.googlemail.com with ESMTPSA id p39sm4977719qkp.47.2015.10.05.04.03.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2015 04:03:04 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Al Viro Subject: [PATCH v5 17/20] nfsd: have nfsd_test_lock use the nfsd_file cache Date: Mon, 5 Oct 2015 07:02:39 -0400 Message-Id: <1444042962-6947-18-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1444042962-6947-1-git-send-email-jeff.layton@primarydata.com> References: <1444042962-6947-1-git-send-email-jeff.layton@primarydata.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 b72fa6816860..4348af408ccb 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5596,11 +5596,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; }