aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/read.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-14 15:39:59 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:30 -0500
commit84115e1cd4a3614c4e566d4cce31381dce3dbef9 (patch)
tree01b2de7163deb6b3a789811183d8b8c1329b900c /fs/nfs/read.c
parente8914c65f7f8d4e8701b8e78a12b714872ea0402 (diff)
SUNRPC: Cleanup of rpc_task initialisation
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r--fs/nfs/read.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 4587a86adaac..c7f0d5ebd451 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -160,11 +160,17 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data,
160 const struct rpc_call_ops *call_ops, 160 const struct rpc_call_ops *call_ops,
161 unsigned int count, unsigned int offset) 161 unsigned int count, unsigned int offset)
162{ 162{
163 struct inode *inode; 163 struct inode *inode = req->wb_context->path.dentry->d_inode;
164 int flags; 164 int swap_flags = IS_SWAPFILE(inode) ? NFS_RPC_SWAPFLAGS : 0;
165 struct rpc_task_setup task_setup_data = {
166 .rpc_client = NFS_CLIENT(inode),
167 .callback_ops = call_ops,
168 .callback_data = data,
169 .flags = RPC_TASK_ASYNC | swap_flags,
170 };
165 171
166 data->req = req; 172 data->req = req;
167 data->inode = inode = req->wb_context->path.dentry->d_inode; 173 data->inode = inode;
168 data->cred = req->wb_context->cred; 174 data->cred = req->wb_context->cred;
169 175
170 data->args.fh = NFS_FH(inode); 176 data->args.fh = NFS_FH(inode);
@@ -180,8 +186,7 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data,
180 nfs_fattr_init(&data->fattr); 186 nfs_fattr_init(&data->fattr);
181 187
182 /* Set up the initial task struct. */ 188 /* Set up the initial task struct. */
183 flags = RPC_TASK_ASYNC | (IS_SWAPFILE(inode)? NFS_RPC_SWAPFLAGS : 0); 189 rpc_init_task(&data->task, &task_setup_data);
184 rpc_init_task(&data->task, NFS_CLIENT(inode), flags, call_ops, data);
185 NFS_PROTO(inode)->read_setup(data); 190 NFS_PROTO(inode)->read_setup(data);
186 191
187 data->task.tk_cookie = (unsigned long)inode; 192 data->task.tk_cookie = (unsigned long)inode;