Skip to content

Commit

Permalink
nfs: introduce pg_cleanup op for pgio descriptors
Browse files Browse the repository at this point in the history
Add a new operation to nfs_pageio_ops that is called on nfs_pageio_complete.

Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
  • Loading branch information
Weston Andros Adamson authored and Tom Haynes committed Feb 3, 2015
1 parent c220106 commit 2176bf4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/nfs/pagelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}

/**
Expand Down
1 change: 1 addition & 0 deletions include/linux/nfs_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2176bf4

Please sign in to comment.