From patchwork Tue Nov 17 11:52:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 7636451 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 DD312BF90C for ; Tue, 17 Nov 2015 11:54:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 27C17204EA for ; Tue, 17 Nov 2015 11:54:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5268D204E2 for ; Tue, 17 Nov 2015 11:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753286AbbKQLxp (ORCPT ); Tue, 17 Nov 2015 06:53:45 -0500 Received: from mail-qg0-f43.google.com ([209.85.192.43]:33184 "EHLO mail-qg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753513AbbKQLxh (ORCPT ); Tue, 17 Nov 2015 06:53:37 -0500 Received: by qgea14 with SMTP id a14so3418489qge.0 for ; Tue, 17 Nov 2015 03:53:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poochiereds_net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MduBi9HorpRF1ZC8kNim2yCyvnj5YVqOHS7DGUxNa0Q=; b=A8qK1ay5TZZFlJJOmXaaCNQRUB5mWXAaZkkEqFDsz3NUagkSEHrPTOccECuObKRMTn XPrzKZn9El94onjlRJUH8WwpCv+8WbVfyS+KcnZdQXLe20J9pdemx04YJTPw8O+eT8aZ qXC0zUNTG9HxHTTLKllqFy8LmCazUkxZexd3TYfH+p9pLfxWgiZvvoN+bGgc6xi0T+9D hidKpK0x40G1VNh3Te+kCrgDW/HbfzleUhxL95/lg8fewMSRKiU/Y/pndmiXbFNq5If2 4bL6loIzsjBh0vNBIohdYiaP5+RWDSGykGq7zKGQJsbhtA7qoQB0iU7uh6Pv4tu/gNOT UoFw== 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=MduBi9HorpRF1ZC8kNim2yCyvnj5YVqOHS7DGUxNa0Q=; b=XDlLaQWsncqCNfNDRO/Kc7OXACh75qMbvc0WMFcdO+ko5KnH3njKhZmoiP4QjiIYJe 2BDJdt8B6JvvY1T02Cd2ijAzwkPr69ZWKOSfFOCyoluUk2Cs7tTtiZ/9sXyZKdriDGOq bfKv6d+ZKd0zYN47ZVltC+nw8KbtWwVhtaSTVwdkwbo1A6Rp/z2snKkA7VHl8KD0fhoB wsZpivwVCk8eStJ76cBJYJu53/afcO9li4TLL+9/a0ZpN2lJxaZx4BIZVrQuf5DV7I4R iqxEoNGN3Ak+cOsfjlLe9P0PexpFlKgsqpnYgQiwJqmnhnCE8LRIjvXErfcItb6t0N5d bX2Q== X-Gm-Message-State: ALoCoQl2Yzgwtk9LaB+80otSHyTBdd+7FWdyjw6jDXrrvW6c3XOvUc8EdE/qR1RQk1F7spHLW9A4 X-Received: by 10.140.216.135 with SMTP id m129mr43408846qhb.90.1447761217346; Tue, 17 Nov 2015 03:53:37 -0800 (PST) Received: from tlielax.poochiereds.net ([2606:a000:1125:4075::d5a]) by smtp.googlemail.com with ESMTPSA id w10sm1583910qhc.16.2015.11.17.03.53.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Nov 2015 03:53:36 -0800 (PST) From: Jeff Layton X-Google-Original-From: Jeff Layton To: bfields@fieldses.org, trond.myklebust@primarydata.com Cc: linux-nfs@vger.kernel.org, Eric Paris , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: [PATCH v1 19/38] nfsd: have nfsd_test_lock use the nfsd_file cache Date: Tue, 17 Nov 2015 06:52:41 -0500 Message-Id: <1447761180-4250-20-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1447761180-4250-1-git-send-email-jeff.layton@primarydata.com> References: <1447761180-4250-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.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 e7adb6b60005..5007095d0228 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5707,11 +5707,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; }