From patchwork Tue Dec 16 19:01:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5503041 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AED659F326 for ; Tue, 16 Dec 2014 19:03:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB23B209D2 for ; Tue, 16 Dec 2014 19:03:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B906209C4 for ; Tue, 16 Dec 2014 19:03:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750960AbaLPTC7 (ORCPT ); Tue, 16 Dec 2014 14:02:59 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:37663 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291AbaLPTC6 (ORCPT ); Tue, 16 Dec 2014 14:02:58 -0500 Received: by mail-pa0-f53.google.com with SMTP id kq14so14695812pab.40 for ; Tue, 16 Dec 2014 11:02:57 -0800 (PST) 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=5IfF1koQ68ETXle6Wakch/inCWuqJ4r4ECU4m7B5OhA=; b=PfJQD5sUPDmtZYiA+c51VMCmED4kvysQpqPE1h+c1TaG9LALzsbx4E+ZoLwz3PlhRD xnyE3AbBUU5DJqgv+8v1V7WYOV5RYK3XjZYG+T4htNWInFR/yvhecgGnmTJFEUlJPqbs /DAE+qUHpvGAUWq5hOtYyacl5kowjJ5ZRuM7cZHX8ORQLHCfM2t4z5ciekoZzGiEFDbt AdTSgwl960oI+N0soLg6xQjpeCuWb3wYhNBMZkstDHYQH29rUwO116NAvEnf2yK/N4+S uNDhoxLQ9A5bJVBLCUcA4gevc6LGUKtCzMI9nBDOVC0qboUbU65zg+wIUZZnrEUmibgp ylLA== X-Gm-Message-State: ALoCoQldRSUYeGzutdAlDiJBzvvwxwntkgxXxa44J37v6V7NqOGpjq/TOa+rrvrDymIZtE20NMgK X-Received: by 10.68.246.164 with SMTP id xx4mr8849902pbc.64.1418756577495; Tue, 16 Dec 2014 11:02:57 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id q4sm1620669pdh.79.2014.12.16.11.02.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 11:02:56 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing List Subject: [PATCH 30/50] nfs: introduce pg_cleanup op for pgio descriptors Date: Tue, 16 Dec 2014 11:01:33 -0800 Message-Id: <1418756513-95187-31-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1418756513-95187-1-git-send-email-loghyr@primarydata.com> References: <1418756513-95187-1-git-send-email-loghyr@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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 From: Weston Andros Adamson Add a new operation to nfs_pageio_ops that is called on nfs_pageio_complete. Signed-off-by: Weston Andros Adamson --- fs/nfs/pagelist.c | 5 ++++- include/linux/nfs_page.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index c4d1758..1c03187 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -1050,7 +1050,7 @@ int nfs_pageio_resend(struct nfs_pageio_descriptor *desc, EXPORT_SYMBOL_GPL(nfs_pageio_resend); /** - * nfs_pageio_complete - Complete I/O on an nfs_pageio_descriptor + * nfs_pageio_complete - Complete I/O then cleanup an nfs_pageio_descriptor * @desc: pointer to io descriptor */ void nfs_pageio_complete(struct nfs_pageio_descriptor *desc) @@ -1062,6 +1062,9 @@ void nfs_pageio_complete(struct nfs_pageio_descriptor *desc) if (!nfs_do_recoalesce(desc)) break; } + + if (desc->pg_ops->pg_cleanup) + desc->pg_ops->pg_cleanup(desc); } /** diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 4c3aa80..479c566 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h @@ -58,6 +58,7 @@ struct nfs_pageio_ops { size_t (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); int (*pg_doio)(struct nfs_pageio_descriptor *); + void (*pg_cleanup)(struct nfs_pageio_descriptor *); }; struct nfs_rw_ops {