diff options
author | Jeff Layton <jlayton@redhat.com> | 2014-03-17 07:06:57 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-03-17 15:14:17 -0400 |
commit | 33912be816d96e204ed7a93690552daa39c08ea9 (patch) | |
tree | 4cfb64955c4b76595436e5efccc5aecb724c7099 /fs/nfs | |
parent | 80a491fd40770db143d250772778ff4f89b807ef (diff) |
nfs: remove synchronous rename code
Now that nfs_rename uses the async infrastructure, we can remove this.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Tested-by: Anna Schumaker <Anna.Schumaker@netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs3proc.c | 36 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 44 | ||||
-rw-r--r-- | fs/nfs/proc.c | 25 |
3 files changed, 0 insertions, 105 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index aa9bc973f36a..251e6253fc36 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -478,41 +478,6 @@ nfs3_proc_rename_done(struct rpc_task *task, struct inode *old_dir, | |||
478 | } | 478 | } |
479 | 479 | ||
480 | static int | 480 | static int |
481 | nfs3_proc_rename(struct inode *old_dir, struct qstr *old_name, | ||
482 | struct inode *new_dir, struct qstr *new_name) | ||
483 | { | ||
484 | struct nfs_renameargs arg = { | ||
485 | .old_dir = NFS_FH(old_dir), | ||
486 | .old_name = old_name, | ||
487 | .new_dir = NFS_FH(new_dir), | ||
488 | .new_name = new_name, | ||
489 | }; | ||
490 | struct nfs_renameres res; | ||
491 | struct rpc_message msg = { | ||
492 | .rpc_proc = &nfs3_procedures[NFS3PROC_RENAME], | ||
493 | .rpc_argp = &arg, | ||
494 | .rpc_resp = &res, | ||
495 | }; | ||
496 | int status = -ENOMEM; | ||
497 | |||
498 | dprintk("NFS call rename %s -> %s\n", old_name->name, new_name->name); | ||
499 | |||
500 | res.old_fattr = nfs_alloc_fattr(); | ||
501 | res.new_fattr = nfs_alloc_fattr(); | ||
502 | if (res.old_fattr == NULL || res.new_fattr == NULL) | ||
503 | goto out; | ||
504 | |||
505 | status = rpc_call_sync(NFS_CLIENT(old_dir), &msg, 0); | ||
506 | nfs_post_op_update_inode(old_dir, res.old_fattr); | ||
507 | nfs_post_op_update_inode(new_dir, res.new_fattr); | ||
508 | out: | ||
509 | nfs_free_fattr(res.old_fattr); | ||
510 | nfs_free_fattr(res.new_fattr); | ||
511 | dprintk("NFS reply rename: %d\n", status); | ||
512 | return status; | ||
513 | } | ||
514 | |||
515 | static int | ||
516 | nfs3_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) | 481 | nfs3_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) |
517 | { | 482 | { |
518 | struct nfs3_linkargs arg = { | 483 | struct nfs3_linkargs arg = { |
@@ -967,7 +932,6 @@ const struct nfs_rpc_ops nfs_v3_clientops = { | |||
967 | .unlink_setup = nfs3_proc_unlink_setup, | 932 | .unlink_setup = nfs3_proc_unlink_setup, |
968 | .unlink_rpc_prepare = nfs3_proc_unlink_rpc_prepare, | 933 | .unlink_rpc_prepare = nfs3_proc_unlink_rpc_prepare, |
969 | .unlink_done = nfs3_proc_unlink_done, | 934 | .unlink_done = nfs3_proc_unlink_done, |
970 | .rename = nfs3_proc_rename, | ||
971 | .rename_setup = nfs3_proc_rename_setup, | 935 | .rename_setup = nfs3_proc_rename_setup, |
972 | .rename_rpc_prepare = nfs3_proc_rename_rpc_prepare, | 936 | .rename_rpc_prepare = nfs3_proc_rename_rpc_prepare, |
973 | .rename_done = nfs3_proc_rename_done, | 937 | .rename_done = nfs3_proc_rename_done, |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 2427ef4c4d63..013b97afb371 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3544,49 +3544,6 @@ static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir, | |||
3544 | return 1; | 3544 | return 1; |
3545 | } | 3545 | } |
3546 | 3546 | ||
3547 | static int _nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name, | ||
3548 | struct inode *new_dir, struct qstr *new_name) | ||
3549 | { | ||
3550 | struct nfs_server *server = NFS_SERVER(old_dir); | ||
3551 | struct nfs_renameargs arg = { | ||
3552 | .old_dir = NFS_FH(old_dir), | ||
3553 | .new_dir = NFS_FH(new_dir), | ||
3554 | .old_name = old_name, | ||
3555 | .new_name = new_name, | ||
3556 | }; | ||
3557 | struct nfs_renameres res = { | ||
3558 | .server = server, | ||
3559 | }; | ||
3560 | struct rpc_message msg = { | ||
3561 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RENAME], | ||
3562 | .rpc_argp = &arg, | ||
3563 | .rpc_resp = &res, | ||
3564 | }; | ||
3565 | int status = -ENOMEM; | ||
3566 | |||
3567 | status = nfs4_call_sync(server->client, server, &msg, &arg.seq_args, &res.seq_res, 1); | ||
3568 | if (!status) { | ||
3569 | update_changeattr(old_dir, &res.old_cinfo); | ||
3570 | update_changeattr(new_dir, &res.new_cinfo); | ||
3571 | } | ||
3572 | return status; | ||
3573 | } | ||
3574 | |||
3575 | static int nfs4_proc_rename(struct inode *old_dir, struct qstr *old_name, | ||
3576 | struct inode *new_dir, struct qstr *new_name) | ||
3577 | { | ||
3578 | struct nfs4_exception exception = { }; | ||
3579 | int err; | ||
3580 | do { | ||
3581 | err = _nfs4_proc_rename(old_dir, old_name, | ||
3582 | new_dir, new_name); | ||
3583 | trace_nfs4_rename(old_dir, old_name, new_dir, new_name, err); | ||
3584 | err = nfs4_handle_exception(NFS_SERVER(old_dir), err, | ||
3585 | &exception); | ||
3586 | } while (exception.retry); | ||
3587 | return err; | ||
3588 | } | ||
3589 | |||
3590 | static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) | 3547 | static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) |
3591 | { | 3548 | { |
3592 | struct nfs_server *server = NFS_SERVER(inode); | 3549 | struct nfs_server *server = NFS_SERVER(inode); |
@@ -8444,7 +8401,6 @@ const struct nfs_rpc_ops nfs_v4_clientops = { | |||
8444 | .unlink_setup = nfs4_proc_unlink_setup, | 8401 | .unlink_setup = nfs4_proc_unlink_setup, |
8445 | .unlink_rpc_prepare = nfs4_proc_unlink_rpc_prepare, | 8402 | .unlink_rpc_prepare = nfs4_proc_unlink_rpc_prepare, |
8446 | .unlink_done = nfs4_proc_unlink_done, | 8403 | .unlink_done = nfs4_proc_unlink_done, |
8447 | .rename = nfs4_proc_rename, | ||
8448 | .rename_setup = nfs4_proc_rename_setup, | 8404 | .rename_setup = nfs4_proc_rename_setup, |
8449 | .rename_rpc_prepare = nfs4_proc_rename_rpc_prepare, | 8405 | .rename_rpc_prepare = nfs4_proc_rename_rpc_prepare, |
8450 | .rename_done = nfs4_proc_rename_done, | 8406 | .rename_done = nfs4_proc_rename_done, |
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index fddbba2d9eff..e55ce9e8b034 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
@@ -357,30 +357,6 @@ nfs_proc_rename_done(struct rpc_task *task, struct inode *old_dir, | |||
357 | } | 357 | } |
358 | 358 | ||
359 | static int | 359 | static int |
360 | nfs_proc_rename(struct inode *old_dir, struct qstr *old_name, | ||
361 | struct inode *new_dir, struct qstr *new_name) | ||
362 | { | ||
363 | struct nfs_renameargs arg = { | ||
364 | .old_dir = NFS_FH(old_dir), | ||
365 | .old_name = old_name, | ||
366 | .new_dir = NFS_FH(new_dir), | ||
367 | .new_name = new_name, | ||
368 | }; | ||
369 | struct rpc_message msg = { | ||
370 | .rpc_proc = &nfs_procedures[NFSPROC_RENAME], | ||
371 | .rpc_argp = &arg, | ||
372 | }; | ||
373 | int status; | ||
374 | |||
375 | dprintk("NFS call rename %s -> %s\n", old_name->name, new_name->name); | ||
376 | status = rpc_call_sync(NFS_CLIENT(old_dir), &msg, 0); | ||
377 | nfs_mark_for_revalidate(old_dir); | ||
378 | nfs_mark_for_revalidate(new_dir); | ||
379 | dprintk("NFS reply rename: %d\n", status); | ||
380 | return status; | ||
381 | } | ||
382 | |||
383 | static int | ||
384 | nfs_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) | 360 | nfs_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) |
385 | { | 361 | { |
386 | struct nfs_linkargs arg = { | 362 | struct nfs_linkargs arg = { |
@@ -745,7 +721,6 @@ const struct nfs_rpc_ops nfs_v2_clientops = { | |||
745 | .unlink_setup = nfs_proc_unlink_setup, | 721 | .unlink_setup = nfs_proc_unlink_setup, |
746 | .unlink_rpc_prepare = nfs_proc_unlink_rpc_prepare, | 722 | .unlink_rpc_prepare = nfs_proc_unlink_rpc_prepare, |
747 | .unlink_done = nfs_proc_unlink_done, | 723 | .unlink_done = nfs_proc_unlink_done, |
748 | .rename = nfs_proc_rename, | ||
749 | .rename_setup = nfs_proc_rename_setup, | 724 | .rename_setup = nfs_proc_rename_setup, |
750 | .rename_rpc_prepare = nfs_proc_rename_rpc_prepare, | 725 | .rename_rpc_prepare = nfs_proc_rename_rpc_prepare, |
751 | .rename_done = nfs_proc_rename_done, | 726 | .rename_done = nfs_proc_rename_done, |