diff options
author | Anna Schumaker <Anna.Schumaker@netapp.com> | 2014-05-06 09:12:31 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-05-28 18:40:28 -0400 |
commit | a4cdda59111f92000297e0d3edb1e0e08ba3549b (patch) | |
tree | 82d09653ae72768829c50c4138b7dc35b6c9f86b /fs/nfs/pagelist.c | |
parent | 4a0de55c565a36cac8422b76a948c4634a90781e (diff) |
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) | |||
387 | EXPORT_SYMBOL_GPL(nfs_pgio_data_release); | 387 | EXPORT_SYMBOL_GPL(nfs_pgio_data_release); |
388 | 388 | ||
389 | /** | 389 | /** |
390 | * nfs_pgio_prepare - Prepare pageio data to go over the wire | ||
391 | * @task: The current task | ||
392 | * @calldata: pageio data to prepare | ||
393 | */ | ||
394 | void nfs_pgio_prepare(struct rpc_task *task, void *calldata) | ||
395 | { | ||
396 | struct nfs_pgio_data *data = calldata; | ||
397 | int err; | ||
398 | err = NFS_PROTO(data->header->inode)->pgio_rpc_prepare(task, data); | ||
399 | if (err) | ||
400 | rpc_exit(task, err); | ||
401 | } | ||
402 | |||
403 | /** | ||
404 | * nfs_pgio_release - Release pageio data | ||
405 | * @calldata: The pageio data to release | ||
406 | */ | ||
407 | void nfs_pgio_release(void *calldata) | ||
408 | { | ||
409 | struct nfs_pgio_data *data = calldata; | ||
410 | if (data->header->rw_ops->rw_release) | ||
411 | data->header->rw_ops->rw_release(data); | ||
412 | nfs_pgio_data_release(data); | ||
413 | } | ||
414 | |||
415 | /** | ||
390 | * nfs_pageio_init - initialise a page io descriptor | 416 | * nfs_pageio_init - initialise a page io descriptor |
391 | * @desc: pointer to descriptor | 417 | * @desc: pointer to descriptor |
392 | * @inode: pointer to inode | 418 | * @inode: pointer to inode |