aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pagelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r--fs/nfs/pagelist.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index aabff78dc6e5..0ccd95116968 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -389,6 +389,50 @@ void nfs_pgio_data_release(struct nfs_pgio_data *data)
389EXPORT_SYMBOL_GPL(nfs_pgio_data_release); 389EXPORT_SYMBOL_GPL(nfs_pgio_data_release);
390 390
391/** 391/**
392 * nfs_pgio_rpcsetup - Set up arguments for a pageio call
393 * @data: The pageio data
394 * @count: Number of bytes to read
395 * @offset: Initial offset
396 * @how: How to commit data (writes only)
397 * @cinfo: Commit information for the call (writes only)
398 */
399void nfs_pgio_rpcsetup(struct nfs_pgio_data *data,
400 unsigned int count, unsigned int offset,
401 int how, struct nfs_commit_info *cinfo)
402{
403 struct nfs_page *req = data->header->req;
404
405 /* Set up the RPC argument and reply structs
406 * NB: take care not to mess about with data->commit et al. */
407
408 data->args.fh = NFS_FH(data->header->inode);
409 data->args.offset = req_offset(req) + offset;
410 /* pnfs_set_layoutcommit needs this */
411 data->mds_offset = data->args.offset;
412 data->args.pgbase = req->wb_pgbase + offset;
413 data->args.pages = data->pages.pagevec;
414 data->args.count = count;
415 data->args.context = get_nfs_open_context(req->wb_context);
416 data->args.lock_context = req->wb_lock_context;
417 data->args.stable = NFS_UNSTABLE;
418 switch (how & (FLUSH_STABLE | FLUSH_COND_STABLE)) {
419 case 0:
420 break;
421 case FLUSH_COND_STABLE:
422 if (nfs_reqs_to_commit(cinfo))
423 break;
424 default:
425 data->args.stable = NFS_FILE_SYNC;
426 }
427
428 data->res.fattr = &data->fattr;
429 data->res.count = count;
430 data->res.eof = 0;
431 data->res.verf = &data->verf;
432 nfs_fattr_init(&data->fattr);
433}
434
435/**
392 * nfs_pgio_prepare - Prepare pageio data to go over the wire 436 * nfs_pgio_prepare - Prepare pageio data to go over the wire
393 * @task: The current task 437 * @task: The current task
394 * @calldata: pageio data to prepare 438 * @calldata: pageio data to prepare