nfs: introduce pg_cleanup op for pgio descriptors
authorWeston Andros Adamson <dros@primarydata.com>
Wed, 10 Sep 2014 19:44:18 +0000 (15:44 -0400)
committerTom Haynes <loghyr@primarydata.com>
Tue, 3 Feb 2015 19:06:43 +0000 (11:06 -0800)
Add a new operation to nfs_pageio_ops that is called on nfs_pageio_complete.

Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
fs/nfs/pagelist.c
include/linux/nfs_page.h

index c4d175829880ebea6f484210eea24d7907bcbddc..1c031878c75257e0d307dee80d8341fad9b33c4c 100644 (file)
@@ -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);
 }
 
 /**
index 4c3aa809ab95bddb7ea0049144f01fac72a37712..479c566c4ddcb62d3cfc686a5c494f120a75307b 100644 (file)
@@ -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 {