From patchwork Tue May 20 18:08:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schumaker, Anna" X-Patchwork-Id: 4212421 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 EC5CFBEEAB for ; Tue, 20 May 2014 18:08:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F6F120212 for ; Tue, 20 May 2014 18:08:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34DEB2017E for ; Tue, 20 May 2014 18:08:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751610AbaETSIf (ORCPT ); Tue, 20 May 2014 14:08:35 -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 S1751411AbaETSId (ORCPT ); Tue, 20 May 2014 14:08:33 -0400 X-IronPort-AV: E=Sophos;i="4.98,875,1392192000"; d="scan'208";a="124239567" Received: from vmwexceht02-prd.hq.netapp.com ([10.106.76.240]) by mx11-out.netapp.com with ESMTP; 20 May 2014 11:08:33 -0700 Received: from VMWEXCHTS03-PRD.hq.netapp.com (10.122.105.31) by vmwexceht02-prd.hq.netapp.com (10.106.76.240) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 20 May 2014 11:08:32 -0700 Received: from smtp2.corp.netapp.com (10.57.159.114) by VMWEXCHTS03-PRD.hq.netapp.com (10.122.105.31) with Microsoft SMTP Server id 15.0.847.32; Tue, 20 May 2014 11:08:31 -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 s4KI8LYp029501; Tue, 20 May 2014 11:08:31 -0700 (PDT) From: Anna Schumaker To: , CC: , Subject: [RFC 09/12] nfs: create a common pnfs_pgiohdr_free function Date: Tue, 20 May 2014 14:08:16 -0400 Message-ID: <1400609299-32558-10-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 This function is exactly the same for reads and writes. Signed-off-by: Anna Schumaker --- fs/nfs/pnfs.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 69751d4..b6ebea8 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1499,6 +1499,12 @@ pnfs_do_rw(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr, return ret; } +static void pnfs_pgiohdr_free(struct nfs_pgio_header *hdr) +{ + pnfs_put_lseg(hdr->lseg); + nfs_pgio_header_free(hdr); +} + void pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req, u64 wb_size) @@ -1541,13 +1547,6 @@ pnfs_do_write(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr) nfs_inc_stats(hdr->inode, NFSIOS_PNFS_WRITE); } -static void pnfs_writehdr_free(struct nfs_pgio_header *hdr) -{ - pnfs_put_lseg(hdr->lseg); - nfs_pgio_header_free(hdr); -} -EXPORT_SYMBOL_GPL(pnfs_writehdr_free); - int pnfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc) { @@ -1561,7 +1560,7 @@ pnfs_generic_pg_writepages(struct nfs_pageio_descriptor *desc) desc->pg_lseg = NULL; return -ENOMEM; } - nfs_pgheader_init(desc, hdr, pnfs_writehdr_free); + nfs_pgheader_init(desc, hdr, pnfs_pgiohdr_free); hdr->lseg = pnfs_get_lseg(desc->pg_lseg); ret = nfs_generic_pgio(desc, hdr); if (ret != 0) { @@ -1623,13 +1622,6 @@ pnfs_do_read(struct nfs_pageio_descriptor *desc, struct nfs_pgio_header *hdr) nfs_inc_stats(hdr->inode, NFSIOS_PNFS_READ); } -static void pnfs_readhdr_free(struct nfs_pgio_header *hdr) -{ - pnfs_put_lseg(hdr->lseg); - nfs_pgio_header_free(hdr); -} -EXPORT_SYMBOL_GPL(pnfs_readhdr_free); - int pnfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc) { @@ -1644,7 +1636,7 @@ pnfs_generic_pg_readpages(struct nfs_pageio_descriptor *desc) desc->pg_lseg = NULL; return ret; } - nfs_pgheader_init(desc, hdr, pnfs_readhdr_free); + nfs_pgheader_init(desc, hdr, pnfs_pgiohdr_free); hdr->lseg = pnfs_get_lseg(desc->pg_lseg); ret = nfs_generic_pgio(desc, hdr); if (ret != 0) {