diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index a3c21cc4677b..c46e45e9b33f 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2566,6 +2566,34 @@ static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir) | |||
2566 | return 1; | 2566 | return 1; |
2567 | } | 2567 | } |
2568 | 2568 | ||
2569 | static void nfs4_proc_rename_setup(struct rpc_message *msg, struct inode *dir) | ||
2570 | { | ||
2571 | struct nfs_server *server = NFS_SERVER(dir); | ||
2572 | struct nfs_renameargs *arg = msg->rpc_argp; | ||
2573 | struct nfs_renameres *res = msg->rpc_resp; | ||
2574 | |||
2575 | msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENAME]; | ||
2576 | arg->bitmask = server->attr_bitmask; | ||
2577 | res->server = server; | ||
2578 | } | ||
2579 | |||
2580 | static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir, | ||
2581 | struct inode *new_dir) | ||
2582 | { | ||
2583 | struct nfs_renameres *res = task->tk_msg.rpc_resp; | ||
2584 | |||
2585 | if (!nfs4_sequence_done(task, &res->seq_res)) | ||
2586 | return 0; | ||
2587 | if (nfs4_async_handle_error(task, res->server, NULL) == -EAGAIN) | ||
2588 | return 0; | ||
2589 | |||
2590 | update_changeattr(old_dir, &res->old_cinfo); | ||
2591 | nfs_post_op_update_inode(old_dir, res->old_fattr); | ||
2592 | update_changeattr(new_dir, &res->new_cinfo); | ||
2593 | nfs_post_op_update_inode(new_dir, res->new_fattr); | ||
2594 | return 1; | ||
2595 | } | ||
2596 | |||
2569 | static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name, | 2597 | static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name, |
2570 | struct inode *new_dir, struct qstr *new_name) | 2598 | struct inode *new_dir, struct qstr *new_name) |
2571 | { | 2599 | { |
@@ -5338,6 +5366,8 @@ const struct nfs_rpc_ops nfs_v4_clientops = { | |||
5338 | .unlink_setup = nfs4_proc_unlink_setup, | 5366 | .unlink_setup = nfs4_proc_unlink_setup, |
5339 | .unlink_done = nfs4_proc_unlink_done, | 5367 | .unlink_done = nfs4_proc_unlink_done, |
5340 | .rename = nfs4_proc_rename, | 5368 | .rename = nfs4_proc_rename, |
5369 | .rename_setup = nfs4_proc_rename_setup, | ||
5370 | .rename_done = nfs4_proc_rename_done, | ||
5341 | .link = nfs4_proc_link, | 5371 | .link = nfs4_proc_link, |
5342 | .symlink = nfs4_proc_symlink, | 5372 | .symlink = nfs4_proc_symlink, |
5343 | .mkdir = nfs4_proc_mkdir, | 5373 | .mkdir = nfs4_proc_mkdir, |