aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@primarydata.com>2014-09-10 15:44:18 -0400
committerTom Haynes <loghyr@primarydata.com>2015-02-03 14:06:43 -0500
commit2176bf4269a37a7742230ed6c91668241bfe1b2b (patch)
tree36481b82bcb62667865f5b784580c656125b823c
parentc220106fb45909719295474e2497ffe03e47dfb3 (diff)
nfs: introduce pg_cleanup op for pgio descriptors
Add a new operation to nfs_pageio_ops that is called on nfs_pageio_complete. Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
-rw-r--r--fs/nfs/pagelist.c5
-rw-r--r--include/linux/nfs_page.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index c4d175829880..1c031878c752 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -1050,7 +1050,7 @@ int nfs_pageio_resend(struct nfs_pageio_descriptor *desc,
1050EXPORT_SYMBOL_GPL(nfs_pageio_resend); 1050EXPORT_SYMBOL_GPL(nfs_pageio_resend);
1051 1051
1052/** 1052/**
1053 * nfs_pageio_complete - Complete I/O on an nfs_pageio_descriptor 1053 * nfs_pageio_complete - Complete I/O then cleanup an nfs_pageio_descriptor
1054 * @desc: pointer to io descriptor 1054 * @desc: pointer to io descriptor
1055 */ 1055 */
1056void nfs_pageio_complete(struct nfs_pageio_descriptor *desc) 1056void nfs_pageio_complete(struct nfs_pageio_descriptor *desc)
@@ -1062,6 +1062,9 @@ void nfs_pageio_complete(struct nfs_pageio_descriptor *desc)
1062 if (!nfs_do_recoalesce(desc)) 1062 if (!nfs_do_recoalesce(desc))
1063 break; 1063 break;
1064 } 1064 }
1065
1066 if (desc->pg_ops->pg_cleanup)
1067 desc->pg_ops->pg_cleanup(desc);
1065} 1068}
1066 1069
1067/** 1070/**
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 4c3aa809ab95..479c566c4ddc 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -58,6 +58,7 @@ struct nfs_pageio_ops {
58 size_t (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, 58 size_t (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *,
59 struct nfs_page *); 59 struct nfs_page *);
60 int (*pg_doio)(struct nfs_pageio_descriptor *); 60 int (*pg_doio)(struct nfs_pageio_descriptor *);
61 void (*pg_cleanup)(struct nfs_pageio_descriptor *);
61}; 62};
62 63
63struct nfs_rw_ops { 64struct nfs_rw_ops {