aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/nfs3proc.c6
-rw-r--r--fs/nfs/nfs4proc.c11
-rw-r--r--fs/nfs/proc.c6
-rw-r--r--fs/nfs/unlink.c23
-rw-r--r--include/linux/nfs_xdr.h13
5 files changed, 37 insertions, 22 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 7f3f957f677c..5242eae6711a 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -450,6 +450,11 @@ nfs3_proc_rename_setup(struct rpc_message *msg, struct inode *dir)
450 msg->rpc_proc = &nfs3_procedures[NFS3PROC_RENAME]; 450 msg->rpc_proc = &nfs3_procedures[NFS3PROC_RENAME];
451} 451}
452 452
453static void nfs3_proc_rename_rpc_prepare(struct rpc_task *task, struct nfs_renamedata *data)
454{
455 rpc_call_start(task);
456}
457
453static int 458static int
454nfs3_proc_rename_done(struct rpc_task *task, struct inode *old_dir, 459nfs3_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
455 struct inode *new_dir) 460 struct inode *new_dir)
@@ -883,6 +888,7 @@ const struct nfs_rpc_ops nfs_v3_clientops = {
883 .unlink_done = nfs3_proc_unlink_done, 888 .unlink_done = nfs3_proc_unlink_done,
884 .rename = nfs3_proc_rename, 889 .rename = nfs3_proc_rename,
885 .rename_setup = nfs3_proc_rename_setup, 890 .rename_setup = nfs3_proc_rename_setup,
891 .rename_rpc_prepare = nfs3_proc_rename_rpc_prepare,
886 .rename_done = nfs3_proc_rename_done, 892 .rename_done = nfs3_proc_rename_done,
887 .link = nfs3_proc_link, 893 .link = nfs3_proc_link,
888 .symlink = nfs3_proc_symlink, 894 .symlink = nfs3_proc_symlink,
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 9c247fa7915a..b76dd0efae75 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2814,6 +2814,16 @@ static void nfs4_proc_rename_setup(struct rpc_message *msg, struct inode *dir)
2814 nfs41_init_sequence(&arg->seq_args, &res->seq_res, 1); 2814 nfs41_init_sequence(&arg->seq_args, &res->seq_res, 1);
2815} 2815}
2816 2816
2817static void nfs4_proc_rename_rpc_prepare(struct rpc_task *task, struct nfs_renamedata *data)
2818{
2819 if (nfs4_setup_sequence(NFS_SERVER(data->old_dir),
2820 &data->args.seq_args,
2821 &data->res.seq_res,
2822 task))
2823 return;
2824 rpc_call_start(task);
2825}
2826
2817static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir, 2827static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
2818 struct inode *new_dir) 2828 struct inode *new_dir)
2819{ 2829{
@@ -6465,6 +6475,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
6465 .unlink_done = nfs4_proc_unlink_done, 6475 .unlink_done = nfs4_proc_unlink_done,
6466 .rename = nfs4_proc_rename, 6476 .rename = nfs4_proc_rename,
6467 .rename_setup = nfs4_proc_rename_setup, 6477 .rename_setup = nfs4_proc_rename_setup,
6478 .rename_rpc_prepare = nfs4_proc_rename_rpc_prepare,
6468 .rename_done = nfs4_proc_rename_done, 6479 .rename_done = nfs4_proc_rename_done,
6469 .link = nfs4_proc_link, 6480 .link = nfs4_proc_link,
6470 .symlink = nfs4_proc_symlink, 6481 .symlink = nfs4_proc_symlink,
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 528b9a2fae05..b63b6f4d14fb 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -377,6 +377,11 @@ nfs_proc_rename_setup(struct rpc_message *msg, struct inode *dir)
377 msg->rpc_proc = &nfs_procedures[NFSPROC_RENAME]; 377 msg->rpc_proc = &nfs_procedures[NFSPROC_RENAME];
378} 378}
379 379
380static void nfs_proc_rename_rpc_prepare(struct rpc_task *task, struct nfs_renamedata *data)
381{
382 rpc_call_start(task);
383}
384
380static int 385static int
381nfs_proc_rename_done(struct rpc_task *task, struct inode *old_dir, 386nfs_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
382 struct inode *new_dir) 387 struct inode *new_dir)
@@ -740,6 +745,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
740 .unlink_done = nfs_proc_unlink_done, 745 .unlink_done = nfs_proc_unlink_done,
741 .rename = nfs_proc_rename, 746 .rename = nfs_proc_rename,
742 .rename_setup = nfs_proc_rename_setup, 747 .rename_setup = nfs_proc_rename_setup,
748 .rename_rpc_prepare = nfs_proc_rename_rpc_prepare,
743 .rename_done = nfs_proc_rename_done, 749 .rename_done = nfs_proc_rename_done,
744 .link = nfs_proc_link, 750 .link = nfs_proc_link,
745 .symlink = nfs_proc_symlink, 751 .symlink = nfs_proc_symlink,
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c
index 9c5a7980e244..3210a03342f9 100644
--- a/fs/nfs/unlink.c
+++ b/fs/nfs/unlink.c
@@ -323,18 +323,6 @@ nfs_cancel_async_unlink(struct dentry *dentry)
323 spin_unlock(&dentry->d_lock); 323 spin_unlock(&dentry->d_lock);
324} 324}
325 325
326struct nfs_renamedata {
327 struct nfs_renameargs args;
328 struct nfs_renameres res;
329 struct rpc_cred *cred;
330 struct inode *old_dir;
331 struct dentry *old_dentry;
332 struct nfs_fattr old_fattr;
333 struct inode *new_dir;
334 struct dentry *new_dentry;
335 struct nfs_fattr new_fattr;
336};
337
338/** 326/**
339 * nfs_async_rename_done - Sillyrename post-processing 327 * nfs_async_rename_done - Sillyrename post-processing
340 * @task: rpc_task of the sillyrename 328 * @task: rpc_task of the sillyrename
@@ -385,25 +373,16 @@ static void nfs_async_rename_release(void *calldata)
385 kfree(data); 373 kfree(data);
386} 374}
387 375
388#if defined(CONFIG_NFS_V4_1)
389static void nfs_rename_prepare(struct rpc_task *task, void *calldata) 376static void nfs_rename_prepare(struct rpc_task *task, void *calldata)
390{ 377{
391 struct nfs_renamedata *data = calldata; 378 struct nfs_renamedata *data = calldata;
392 struct nfs_server *server = NFS_SERVER(data->old_dir); 379 NFS_PROTO(data->old_dir)->rename_rpc_prepare(task, data);
393
394 if (nfs4_setup_sequence(server, &data->args.seq_args,
395 &data->res.seq_res, task))
396 return;
397 rpc_call_start(task);
398} 380}
399#endif /* CONFIG_NFS_V4_1 */
400 381
401static const struct rpc_call_ops nfs_rename_ops = { 382static const struct rpc_call_ops nfs_rename_ops = {
402 .rpc_call_done = nfs_async_rename_done, 383 .rpc_call_done = nfs_async_rename_done,
403 .rpc_release = nfs_async_rename_release, 384 .rpc_release = nfs_async_rename_release,
404#if defined(CONFIG_NFS_V4_1)
405 .rpc_call_prepare = nfs_rename_prepare, 385 .rpc_call_prepare = nfs_rename_prepare,
406#endif /* CONFIG_NFS_V4_1 */
407}; 386};
408 387
409/** 388/**
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 8d93e688188d..bfd0d1bf6707 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1201,6 +1201,18 @@ struct nfs_unlinkdata {
1201 struct nfs_fattr dir_attr; 1201 struct nfs_fattr dir_attr;
1202}; 1202};
1203 1203
1204struct nfs_renamedata {
1205 struct nfs_renameargs args;
1206 struct nfs_renameres res;
1207 struct rpc_cred *cred;
1208 struct inode *old_dir;
1209 struct dentry *old_dentry;
1210 struct nfs_fattr old_fattr;
1211 struct inode *new_dir;
1212 struct dentry *new_dentry;
1213 struct nfs_fattr new_fattr;
1214};
1215
1204struct nfs_access_entry; 1216struct nfs_access_entry;
1205struct nfs_client; 1217struct nfs_client;
1206struct rpc_timeout; 1218struct rpc_timeout;
@@ -1235,6 +1247,7 @@ struct nfs_rpc_ops {
1235 int (*rename) (struct inode *, struct qstr *, 1247 int (*rename) (struct inode *, struct qstr *,
1236 struct inode *, struct qstr *); 1248 struct inode *, struct qstr *);
1237 void (*rename_setup) (struct rpc_message *msg, struct inode *dir); 1249 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1250 void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *);
1238 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir); 1251 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
1239 int (*link) (struct inode *, struct inode *, struct qstr *); 1252 int (*link) (struct inode *, struct inode *, struct qstr *);
1240 int (*symlink) (struct inode *, struct dentry *, struct page *, 1253 int (*symlink) (struct inode *, struct dentry *, struct page *,