From patchwork Sat May 27 08:16:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9751683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3324E60393 for ; Sat, 27 May 2017 08:18:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22EA428472 for ; Sat, 27 May 2017 08:18:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17CE22847A; Sat, 27 May 2017 08:18:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CB8F28474 for ; Sat, 27 May 2017 08:18:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754015AbdE0IRz (ORCPT ); Sat, 27 May 2017 04:17:55 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:37664 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754021AbdE0IRx (ORCPT ); Sat, 27 May 2017 04:17:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=YB1G0CyoUvJyFWjAjdglpKPCQjbMDEQdIJp1DXpVmDs=; b=H557CUk0ZT0dMhJLJFC+MPYko OQhZmKgPo9EExowzNfNPgitct9Wk0WgrkCT1A9WcLFJR7G7ryEKn3G0B/KIr/OVeQtkDdHvFwyAzE OM+KpSz5l6ohGYgBDfCcEsxy62KlDWmseTO5lAXEicVhC/4smwwLSB9wu1GVtD52wviEIze5vMR00 3ZGMHikD9pbp8VgVEnOTJ99zA7TiebRxvN8CGYYIGN9ZzME5xGGP9M1z8lZAZb0nBcSBuIFvcy54Q sW34NJJYXeHQOOn62wiPnqGCaI9hQzo8GE/lbaUJ8fynHZozXH7BeYidhDkNSNBDvBAo6h1o1vaRf RZ4ITP84g==; Received: from shol69.static.otenet.gr ([83.235.170.67] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dEWur-0001dy-NP; Sat, 27 May 2017 08:17:42 +0000 From: Christoph Hellwig To: Alexander Viro Cc: "J. Bruce Fields" , Jeff Layton , linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 10/10] nfsd: remove nfsd_vfs_read Date: Sat, 27 May 2017 11:16:54 +0300 Message-Id: <20170527081654.15957-11-hch@lst.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170527081654.15957-1-hch@lst.de> References: <20170527081654.15957-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simpler done in the only caller. Signed-off-by: Christoph Hellwig --- fs/nfsd/vfs.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 37a03c456b38..0d19ab1b9404 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -920,16 +920,6 @@ __be32 nfsd_readv(struct file *file, loff_t offset, struct kvec *vec, int vlen, return nfsd_finish_read(file, count, host_err); } -static __be32 -nfsd_vfs_read(struct svc_rqst *rqstp, struct file *file, - loff_t offset, struct kvec *vec, int vlen, unsigned long *count) -{ - if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &rqstp->rq_flags)) - return nfsd_splice_read(rqstp, file, offset, count); - else - return nfsd_readv(file, offset, vec, vlen, count); -} - /* * Gathered writes: If another process is currently writing to the file, * there's a high chance this is another nfsd (triggered by a bulk write @@ -1041,7 +1031,12 @@ __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, ra = nfsd_init_raparms(file); trace_read_opened(rqstp, fhp, offset, vlen); - err = nfsd_vfs_read(rqstp, file, offset, vec, vlen, count); + + if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &rqstp->rq_flags)) + err = nfsd_splice_read(rqstp, file, offset, count); + else + err = nfsd_readv(file, offset, vec, vlen, count); + trace_read_io_done(rqstp, fhp, offset, vlen); if (ra)