From patchwork Fri Sep 11 10:54: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: 7159491 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 3BEC9BEEC1 for ; Fri, 11 Sep 2015 10:55:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 79DB520855 for ; Fri, 11 Sep 2015 10:55:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0B5B52085B for ; Fri, 11 Sep 2015 10:55:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752810AbbIKKzH (ORCPT ); Fri, 11 Sep 2015 06:55:07 -0400 Received: from mail-yk0-f169.google.com ([209.85.160.169]:35847 "EHLO mail-yk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752809AbbIKKzG (ORCPT ); Fri, 11 Sep 2015 06:55:06 -0400 Received: by ykdt18 with SMTP id t18so66775420ykd.3 for ; Fri, 11 Sep 2015 03:55:05 -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=G+utBcoZUjSonPehpHHpH+00IJI4SLT9o1ZJvT4mRSU=; b=Zq4EqPpASaXY+0Z8y1yinSJx1fFm6FS9lvVIeh7lVeAQ7fx5w9Ueuv+OtwpkAoo363 1RIy0CvHMlPO3WP7yLeXhogwziqkmaZSI5TnLf187C85hpUCGBV422cFyAHvnwhae37G DOtnWW4peYPwaXZlsEpywbgrwwMT7mUThJn3bgI18PU3tzKCNSLV4ki529JPunSRqZcx WTz0TGQkujo+yuC79Qqn3e9bgrHbcjerEkPipPKBMb5tdk+5YP6YtkT0c6nbdV4pxbFm c5so5mkuQ90S4+un43bDRsbMUzPR+zq9QbOMfAiGifGWja5Bf+W3r5Gc6cs9tvalE3V1 K3qw== X-Gm-Message-State: ALoCoQkzZ7LEPjMlYvCqcnWBdp4bXIf7Hu/FS+n46pLSluuhvPfSaKHslFcQ+jNbMI40F7fK0E9k X-Received: by 10.129.138.129 with SMTP id a123mr47302102ywg.29.1441968905853; Fri, 11 Sep 2015 03:55:05 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1105:8e:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id u8sm489915ywe.17.2015.09.11.03.55.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 03:55:05 -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 Subject: [PATCH v4 13/16] nfsd: have nfsd_test_lock use the nfsd_file cache Date: Fri, 11 Sep 2015 06:54:39 -0400 Message-Id: <1441968882-7851-14-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1441968882-7851-1-git-send-email-jeff.layton@primarydata.com> References: <1441968882-7851-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 891c9153a5c6..980383922f6a 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5568,11 +5568,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; }