From patchwork Tue May 20 18:08:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schumaker, Anna" X-Patchwork-Id: 4212441 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 23E90BEEAB for ; Tue, 20 May 2014 18:08:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6A293201DE for ; Tue, 20 May 2014 18:08:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D6A520204 for ; Tue, 20 May 2014 18:08:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751660AbaETSIg (ORCPT ); Tue, 20 May 2014 14:08:36 -0400 Received: from mx12.netapp.com ([216.240.18.77]:16546 "EHLO mx12.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbaETSIb (ORCPT ); Tue, 20 May 2014 14:08:31 -0400 X-IronPort-AV: E=Sophos;i="4.98,875,1392192000"; d="scan'208";a="165539424" Received: from vmwexceht03-prd.hq.netapp.com ([10.106.76.241]) by mx12-out.netapp.com with ESMTP; 20 May 2014 11:08:31 -0700 Received: from VMWEXCHTS04-PRD.hq.netapp.com (10.122.105.32) by vmwexceht03-prd.hq.netapp.com (10.106.76.241) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 20 May 2014 11:08:30 -0700 Received: from smtp2.corp.netapp.com (10.57.159.114) by VMWEXCHTS04-PRD.hq.netapp.com (10.122.105.32) with Microsoft SMTP Server id 15.0.847.32; Tue, 20 May 2014 11:08:30 -0700 Received: from davros.com (davros.ocarinaproject.vpn.netapp.com [10.63.224.110]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id s4KI8LYn029501; Tue, 20 May 2014 11:08:29 -0700 (PDT) From: Anna Schumaker To: , CC: , Subject: [RFC 07/12] nfs: merge pnfs_try_to_read_data() and pnfs_do_read() Date: Tue, 20 May 2014 14:08:14 -0400 Message-ID: <1400609299-32558-8-git-send-email-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1400609299-32558-1-git-send-email-Anna.Schumaker@Netapp.com> References: <1400609299-32558-1-git-send-email-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 This makes these functions look neater in preparation for combining with their write equivilents. Signed-off-by: Anna Schumaker --- fs/nfs/pnfs.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 355cd41..293e970 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1602,37 +1602,23 @@ EXPORT_SYMBOL_GPL(pnfs_ld_read_done); * Call the appropriate parallel I/O subsystem read function. */ static enum pnfs_try_status -pnfs_try_to_read_data(struct nfs_pgio_header *hdr, - const struct rpc_call_ops *call_ops, - struct pnfs_layout_segment *lseg) +pnfs_try_to_read_data(struct nfs_pgio_header *hdr) { - struct inode *inode = hdr->inode; - struct nfs_server *nfss = NFS_SERVER(inode); - enum pnfs_try_status trypnfs; - - hdr->mds_ops = call_ops; - - dprintk("%s: Reading ino:%lu %u@%llu\n", - __func__, inode->i_ino, hdr->args.count, hdr->args.offset); - - trypnfs = nfss->pnfs_curr_ld->read_pagelist(hdr); - if (trypnfs != PNFS_NOT_ATTEMPTED) - nfs_inc_stats(inode, NFSIOS_PNFS_READ); - dprintk("%s End (trypnfs:%d)\n", __func__, trypnfs); - return trypnfs; + return NFS_SERVER(hdr->inode)->pnfs_curr_ld->read_pagelist(hdr); } static void pnfs_do_read(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr) { - const struct rpc_call_ops *call_ops = desc->pg_rpc_callops; struct pnfs_layout_segment *lseg = desc->pg_lseg; - enum pnfs_try_status trypnfs; + hdr->mds_ops = desc->pg_rpc_callops; desc->pg_lseg = NULL; - trypnfs = pnfs_try_to_read_data(hdr, call_ops, lseg); - if (trypnfs == PNFS_NOT_ATTEMPTED) + + if (pnfs_try_to_read_data(hdr) == PNFS_NOT_ATTEMPTED) pnfs_through_mds(desc, hdr); + else + nfs_inc_stats(hdr->inode, NFSIOS_PNFS_READ); pnfs_put_lseg(lseg); }