From patchwork Tue May 20 18:08:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schumaker, Anna" X-Patchwork-Id: 4212391 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 7D259BEEAC for ; Tue, 20 May 2014 18:08:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73F902017E for ; Tue, 20 May 2014 18:08:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFDEB20204 for ; Tue, 20 May 2014 18:08:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751039AbaETSIb (ORCPT ); Tue, 20 May 2014 14:08:31 -0400 Received: from mx11.netapp.com ([216.240.18.76]:53894 "EHLO mx11.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbaETSI3 (ORCPT ); Tue, 20 May 2014 14:08:29 -0400 X-IronPort-AV: E=Sophos;i="4.98,875,1392192000"; d="scan'208";a="124239553" Received: from vmwexceht04-prd.hq.netapp.com ([10.106.77.34]) by mx11-out.netapp.com with ESMTP; 20 May 2014 11:08:28 -0700 Received: from VMWEXCHTS04-PRD.hq.netapp.com (10.122.105.32) by vmwexceht04-prd.hq.netapp.com (10.106.77.34) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 20 May 2014 11:08:28 -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:27 -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 s4KI8LYl029501; Tue, 20 May 2014 11:08:27 -0700 (PDT) From: Anna Schumaker To: , CC: , Subject: [RFC 05/12] nfs: Create a common pnfs_through_mds() function Date: Tue, 20 May 2014 14:08:12 -0400 Message-ID: <1400609299-32558-6-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=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: Anna Schumaker --- fs/nfs/pnfs.c | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 5976b87..a0eee54 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1469,6 +1469,18 @@ static void pnfs_ld_rw_done(struct nfs_pgio_header *hdr, hdr->mds_ops->rpc_release(hdr); } +static void +pnfs_through_mds(struct nfs_pageio_descriptor *desc, + struct nfs_pgio_header *hdr) +{ + if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { + list_splice_tail_init(&hdr->pages, &desc->pg_list); + pnfs_pageio_reset_mds(desc); + desc->pg_recoalesce = 1; + } + nfs_generic_pgio_reset(hdr); +} + void pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req, u64 wb_size) @@ -1498,18 +1510,6 @@ void pnfs_ld_write_done(struct nfs_pgio_header *hdr) } EXPORT_SYMBOL_GPL(pnfs_ld_write_done); -static void -pnfs_write_through_mds(struct nfs_pageio_descriptor *desc, - struct nfs_pgio_header *hdr) -{ - if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { - list_splice_tail_init(&hdr->pages, &desc->pg_list); - pnfs_pageio_reset_mds(desc); - desc->pg_recoalesce = 1; - } - nfs_generic_pgio_reset(hdr); -} - static enum pnfs_try_status pnfs_try_to_write_data(struct nfs_pgio_header *hdr, const struct rpc_call_ops *call_ops, @@ -1542,7 +1542,7 @@ pnfs_do_write(struct nfs_pageio_descriptor *desc, desc->pg_lseg = NULL; trypnfs = pnfs_try_to_write_data(hdr, call_ops, lseg, how); if (trypnfs == PNFS_NOT_ATTEMPTED) - pnfs_write_through_mds(desc, hdr); + pnfs_through_mds(desc, hdr); pnfs_put_lseg(lseg); } @@ -1612,18 +1612,6 @@ void pnfs_ld_read_done(struct nfs_pgio_header *hdr) } EXPORT_SYMBOL_GPL(pnfs_ld_read_done); -static void -pnfs_read_through_mds(struct nfs_pageio_descriptor *desc, - struct nfs_pgio_header *hdr) -{ - if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { - list_splice_tail_init(&hdr->pages, &desc->pg_list); - pnfs_pageio_reset_mds(desc); - desc->pg_recoalesce = 1; - } - nfs_generic_pgio_reset(hdr); -} - /* * Call the appropriate parallel I/O subsystem read function. */ @@ -1658,7 +1646,7 @@ pnfs_do_read(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr) desc->pg_lseg = NULL; trypnfs = pnfs_try_to_read_data(hdr, call_ops, lseg); if (trypnfs == PNFS_NOT_ATTEMPTED) - pnfs_read_through_mds(desc, hdr); + pnfs_through_mds(desc, hdr); pnfs_put_lseg(lseg); }