diff options
author | Anna Schumaker <Anna.Schumaker@netapp.com> | 2014-05-06 15:12:31 +0200 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-05-29 00:40:28 +0200 |
commit | a4cdda59111f92000297e0d3edb1e0e08ba3549b (patch) | |
tree | 82d09653ae72768829c50c4138b7dc35b6c9f86b /fs/nfs/pagelist.c | |
parent | NFS: Create a common rw_header_alloc and rw_header_free function (diff) | |
download | linux-a4cdda59111f92000297e0d3edb1e0e08ba3549b.tar.xz linux-a4cdda59111f92000297e0d3edb1e0e08ba3549b.zip |
NFS: Create a common pgio_rpc_prepare function
The read and write paths do exactly the same thing for the rpc_prepare
rpc_op. This patch combines them together into a single function.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r-- | fs/nfs/pagelist.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index ca356fe0836b..0fa211d35e40 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -387,6 +387,32 @@ void nfs_pgio_data_release(struct nfs_pgio_data *data) EXPORT_SYMBOL_GPL(nfs_pgio_data_release); /** + * nfs_pgio_prepare - Prepare pageio data to go over the wire + * @task: The current task + * @calldata: pageio data to prepare + */ +void nfs_pgio_prepare(struct rpc_task *task, void *calldata) +{ + struct nfs_pgio_data *data = calldata; + int err; + err = NFS_PROTO(data->header->inode)->pgio_rpc_prepare(task, data); + if (err) + rpc_exit(task, err); +} + +/** + * nfs_pgio_release - Release pageio data + * @calldata: The pageio data to release + */ +void nfs_pgio_release(void *calldata) +{ + struct nfs_pgio_data *data = calldata; + if (data->header->rw_ops->rw_release) + data->header->rw_ops->rw_release(data); + nfs_pgio_data_release(data); +} + +/** * nfs_pageio_init - initialise a page io descriptor * @desc: pointer to descriptor * @inode: pointer to inode |