aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/unlink.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-14 15:40:01 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:32 -0500
commit5138fde01161cd7976fdc51f6a17da73adaa6baf (patch)
tree57dea902155fc4c31667ffbc412782edf2593b01 /fs/nfs/unlink.c
parentbdc7f021f3a1fade77adf3c2d7f65690566fddfe (diff)
NFS/SUNRPC: Convert all users of rpc_call_setup()
Replace use of rpc_call_setup() with rpc_init_task(), and in cases where we need to initialise task->tk_action, with rpc_call_start(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/unlink.c')
-rw-r--r--fs/nfs/unlink.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c
index 6660d9a53345..757415363422 100644
--- a/fs/nfs/unlink.c
+++ b/fs/nfs/unlink.c
@@ -71,24 +71,6 @@ static void nfs_dec_sillycount(struct inode *dir)
71} 71}
72 72
73/** 73/**
74 * nfs_async_unlink_init - Initialize the RPC info
75 * task: rpc_task of the sillydelete
76 */
77static void nfs_async_unlink_init(struct rpc_task *task, void *calldata)
78{
79 struct nfs_unlinkdata *data = calldata;
80 struct inode *dir = data->dir;
81 struct rpc_message msg = {
82 .rpc_argp = &data->args,
83 .rpc_resp = &data->res,
84 .rpc_cred = data->cred,
85 };
86
87 NFS_PROTO(dir)->unlink_setup(&msg, dir);
88 rpc_call_setup(task, &msg, 0);
89}
90
91/**
92 * nfs_async_unlink_done - Sillydelete post-processing 74 * nfs_async_unlink_done - Sillydelete post-processing
93 * @task: rpc_task of the sillydelete 75 * @task: rpc_task of the sillydelete
94 * 76 *
@@ -120,14 +102,19 @@ static void nfs_async_unlink_release(void *calldata)
120} 102}
121 103
122static const struct rpc_call_ops nfs_unlink_ops = { 104static const struct rpc_call_ops nfs_unlink_ops = {
123 .rpc_call_prepare = nfs_async_unlink_init,
124 .rpc_call_done = nfs_async_unlink_done, 105 .rpc_call_done = nfs_async_unlink_done,
125 .rpc_release = nfs_async_unlink_release, 106 .rpc_release = nfs_async_unlink_release,
126}; 107};
127 108
128static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct nfs_unlinkdata *data) 109static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct nfs_unlinkdata *data)
129{ 110{
111 struct rpc_message msg = {
112 .rpc_argp = &data->args,
113 .rpc_resp = &data->res,
114 .rpc_cred = data->cred,
115 };
130 struct rpc_task_setup task_setup_data = { 116 struct rpc_task_setup task_setup_data = {
117 .rpc_message = &msg,
131 .callback_ops = &nfs_unlink_ops, 118 .callback_ops = &nfs_unlink_ops,
132 .callback_data = data, 119 .callback_data = data,
133 .flags = RPC_TASK_ASYNC, 120 .flags = RPC_TASK_ASYNC,
@@ -165,8 +152,9 @@ static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct n
165 data->args.fh = NFS_FH(dir); 152 data->args.fh = NFS_FH(dir);
166 nfs_fattr_init(&data->res.dir_attr); 153 nfs_fattr_init(&data->res.dir_attr);
167 154
168 task_setup_data.rpc_client = NFS_CLIENT(dir); 155 NFS_PROTO(dir)->unlink_setup(&msg, dir);
169 156
157 task_setup_data.rpc_client = NFS_CLIENT(dir);
170 task = rpc_run_task(&task_setup_data); 158 task = rpc_run_task(&task_setup_data);
171 if (!IS_ERR(task)) 159 if (!IS_ERR(task))
172 rpc_put_task(task); 160 rpc_put_task(task);