aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pagelist.c
diff options
context:
space:
mode:
authorAnna Schumaker <Anna.Schumaker@netapp.com>2014-05-06 09:12:35 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-05-28 18:41:04 -0400
commit844c9e691d8723853ca8f2de0207683538645824 (patch)
tree81e74dc24a665888727c0e7b26a59db2feea2ecb /fs/nfs/pagelist.c
parentce59515c1484d3a01bc2f3e7043dc488d25efe34 (diff)
NFS: Create a common pgio_error function
At this point, the read and write versions of this function look identical so both should use the same 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.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 0ccd95116968..b0a98daae14c 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -447,6 +447,26 @@ static void nfs_pgio_prepare(struct rpc_task *task, void *calldata)
447} 447}
448 448
449/** 449/**
450 * nfs_pgio_error - Clean up from a pageio error
451 * @desc: IO descriptor
452 * @hdr: pageio header
453 */
454int nfs_pgio_error(struct nfs_pageio_descriptor *desc,
455 struct nfs_pgio_header *hdr)
456{
457 struct nfs_pgio_data *data;
458
459 set_bit(NFS_IOHDR_REDO, &hdr->flags);
460 while (!list_empty(&hdr->rpc_list)) {
461 data = list_first_entry(&hdr->rpc_list, struct nfs_pgio_data, list);
462 list_del(&data->list);
463 nfs_pgio_data_release(data);
464 }
465 desc->pg_completion_ops->error_cleanup(&desc->pg_list);
466 return -ENOMEM;
467}
468
469/**
450 * nfs_pgio_release - Release pageio data 470 * nfs_pgio_release - Release pageio data
451 * @calldata: The pageio data to release 471 * @calldata: The pageio data to release
452 */ 472 */