summaryrefslogtreecommitdiffstats
path: root/fs/nfs/read.c
diff options
context:
space:
mode:
authorAnna Schumaker2014-05-06 15:12:31 +0200
committerTrond Myklebust2014-05-29 00:40:28 +0200
commita4cdda59111f92000297e0d3edb1e0e08ba3549b (patch)
tree82d09653ae72768829c50c4138b7dc35b6c9f86b /fs/nfs/read.c
parentNFS: Create a common rw_header_alloc and rw_header_free function (diff)
downloadkernel-qcow2-linux-a4cdda59111f92000297e0d3edb1e0e08ba3549b.tar.gz
kernel-qcow2-linux-a4cdda59111f92000297e0d3edb1e0e08ba3549b.tar.xz
kernel-qcow2-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/read.c')
-rw-r--r--fs/nfs/read.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 4cf3577bd54e..cfa15e828dd6 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -454,24 +454,10 @@ static void nfs_readpage_result_common(struct rpc_task *task, void *calldata)
nfs_readpage_retry(task, data);
}
-static void nfs_readpage_release_common(void *calldata)
-{
- nfs_pgio_data_release(calldata);
-}
-
-void nfs_read_prepare(struct rpc_task *task, void *calldata)
-{
- struct nfs_pgio_data *data = calldata;
- int err;
- err = NFS_PROTO(data->header->inode)->read_rpc_prepare(task, data);
- if (err)
- rpc_exit(task, err);
-}
-
static const struct rpc_call_ops nfs_read_common_ops = {
- .rpc_call_prepare = nfs_read_prepare,
+ .rpc_call_prepare = nfs_pgio_prepare,
.rpc_call_done = nfs_readpage_result_common,
- .rpc_release = nfs_readpage_release_common,
+ .rpc_release = nfs_pgio_release,
};
/*
@@ -636,6 +622,7 @@ void nfs_destroy_readpagecache(void)
}
static const struct nfs_rw_ops nfs_rw_read_ops = {
+ .rw_mode = FMODE_READ,
.rw_alloc_header = nfs_readhdr_alloc,
.rw_free_header = nfs_readhdr_free,
};