diff options
author | Anna Schumaker <Anna.Schumaker@netapp.com> | 2014-05-06 09:12:34 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-05-28 18:40:56 -0400 |
commit | ce59515c1484d3a01bc2f3e7043dc488d25efe34 (patch) | |
tree | 00c371ca81a26280eab34ad96fae8ca9c95d940d /fs/nfs/read.c | |
parent | 6f92fa4581f1c26562f80dc686b3c9ea76556911 (diff) | |
download | blackbird-op-linux-ce59515c1484d3a01bc2f3e7043dc488d25efe34.tar.gz blackbird-op-linux-ce59515c1484d3a01bc2f3e7043dc488d25efe34.zip |
NFS: Create a common rpcsetup function for reads and writes
Write adds a little bit of code dealing with flush flags, but since
"how" will always be 0 when reading we can share the code.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r-- | fs/nfs/read.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index a33490c0899f..0c88c60fbee9 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -192,28 +192,6 @@ int nfs_initiate_read(struct rpc_clnt *clnt, } EXPORT_SYMBOL_GPL(nfs_initiate_read); -/* - * Set up the NFS read request struct - */ -static void nfs_read_rpcsetup(struct nfs_pgio_data *data, - unsigned int count, unsigned int offset) -{ - struct nfs_page *req = data->header->req; - - data->args.fh = NFS_FH(data->header->inode); - data->args.offset = req_offset(req) + offset; - data->args.pgbase = req->wb_pgbase + offset; - data->args.pages = data->pages.pagevec; - data->args.count = count; - data->args.context = get_nfs_open_context(req->wb_context); - data->args.lock_context = req->wb_lock_context; - - data->res.fattr = &data->fattr; - data->res.count = count; - data->res.eof = 0; - nfs_fattr_init(&data->fattr); -} - static int nfs_do_read(struct nfs_pgio_data *data, const struct rpc_call_ops *call_ops) { @@ -305,7 +283,7 @@ static int nfs_pagein_multi(struct nfs_pageio_descriptor *desc, return -ENOMEM; } data->pages.pagevec[0] = page; - nfs_read_rpcsetup(data, len, offset); + nfs_pgio_rpcsetup(data, len, offset, 0, NULL); list_add(&data->list, &hdr->rpc_list); nbytes -= len; offset += len; @@ -340,7 +318,7 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc, *pages++ = req->wb_page; } - nfs_read_rpcsetup(data, desc->pg_count, 0); + nfs_pgio_rpcsetup(data, desc->pg_count, 0, 0, NULL); list_add(&data->list, &hdr->rpc_list); desc->pg_rpc_callops = &nfs_pgio_common_ops; return 0; |