From patchwork Wed Aug 5 21:13:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 6953051 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 003249F402 for ; Wed, 5 Aug 2015 21:13:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3ABB82052C for ; Wed, 5 Aug 2015 21:13:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 658CC204FF for ; Wed, 5 Aug 2015 21:13:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752577AbbHEVNt (ORCPT ); Wed, 5 Aug 2015 17:13:49 -0400 Received: from mail-yk0-f169.google.com ([209.85.160.169]:36536 "EHLO mail-yk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752471AbbHEVNr (ORCPT ); Wed, 5 Aug 2015 17:13:47 -0400 Received: by ykeo23 with SMTP id o23so46444063yke.3 for ; Wed, 05 Aug 2015 14:13:47 -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=YykbPya3ulgjmq74A4Wb7UPh57Phv1m6P46jcH8xhcM=; b=MwEuzuiSUJAhppixuSuDRUoFq4PSezPg3I66u4/TC+X2k49XKZJUclVvHSOjomKlfd 3hDk2yKM4fptY5hIsBOpG40+g+jiCGK7GGFhtm34kjQSz3z6LVPbXGU11jGCKCIzY0bO EDEgxzdOMGWJbGbL+COx4+STyjKnXxx9zrvrTe4SS65XWy1l5Q9DyB+5wIPHdmGsRdCe /kOBmJau57bkEM/aJNAqGjPJoPIoZOwR5bGJlF7hGyPbBgPy5R6R5X2SYNGwHohizPcX 4Co0tc1t4bFbiiMA2d5dFfUAcusQYGgYlau4S9SPy0mBF2tFuF+syW/fXwrq5758SAmV WxSg== X-Gm-Message-State: ALoCoQkQ7uRGb5NG3hgyfH8g4X/rmZ/Nvvfye8XA2ACePgTFGlndHVlADy12917E6h4+t/JWGLRV X-Received: by 10.170.86.132 with SMTP id d126mr11634359yka.57.1438809227448; Wed, 05 Aug 2015 14:13:47 -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 p81sm3975306ywe.19.2015.08.05.14.13.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Aug 2015 14:13:46 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 06/18] nfsd: hook up nfsd_read to the nfsd_file cache Date: Wed, 5 Aug 2015 17:13:24 -0400 Message-Id: <1438809216-4846-7-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1438809216-4846-1-git-send-email-jeff.layton@primarydata.com> References: <1438264341-18048-1-git-send-email-jeff.layton@primarydata.com> <1438809216-4846-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.0 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/vfs.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 59234d1d8d8e..fd688c86af66 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -980,20 +980,14 @@ out_nfserr: __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, struct kvec *vec, int vlen, unsigned long *count) { - struct file *file; - struct raparms *ra; - __be32 err; - - err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file); - if (err) - return err; - - ra = nfsd_init_raparms(file); - err = nfsd_vfs_read(rqstp, file, offset, vec, vlen, count); - if (ra) - nfsd_put_raparams(file, ra); - fput(file); + __be32 err; + struct nfsd_file *nf; + err = nfsd_file_acquire(rqstp, fhp, NFSD_MAY_READ, &nf); + if (err == nfs_ok) + err = nfsd_vfs_read(rqstp, nf->nf_file, offset, vec, vlen, + count); + nfsd_file_put(nf); return err; }