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: 7326491 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 EFBCEBEEA4 for ; Mon, 5 Oct 2015 11:03:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 23723206E9 for ; Mon, 5 Oct 2015 11:03:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AD8E206EB for ; Mon, 5 Oct 2015 11:03:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750879AbbJELD2 (ORCPT ); Mon, 5 Oct 2015 07:03:28 -0400 Received: from mail-qg0-f46.google.com ([209.85.192.46]:33062 "EHLO mail-qg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751793AbbJELDF (ORCPT ); Mon, 5 Oct 2015 07:03:05 -0400 Received: by qgev79 with SMTP id v79so145484183qge.0 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=NHhfeEwXE9ZrxSzYgbGKNLlC64A6oUkK8bT11lYBj3ONghGKT9dJjivPMsNyxNzja6 ST6PXb9tE3Qv0JpNNbVU9/f9V91I/kWWt8cZ0y2NB/wJZr9m1UoMvYr2TuCvtmjKRdz5 ROk2L44zdLH0pv/gh7vJuEtYiZLGP2gshZ81lQXiMGGmHAptzmvmRaWMGrRD/9xabYro JYLmaIaLAkI51bgRcvNDjkxImVs4w3Dwz60LChn6kHD1ADWJhn9QiHM787qyTBii1WSG U6F5ntaGLDwOPV5/HOWOiPX4hu8Rv1aYFibZ/rbnAEEJ7Ww1sRHQ45VuxkjqlJhbIHF1 FpEA== X-Gm-Message-State: ALoCoQnm0JZSpLHReBkc47P6fxAIF/mjNcSAN8M3hA8Av1GtchceA3YiQpAJpLeZtoSq4iwqKLlk 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-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@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; }