diff options
Diffstat (limited to 'fs/nfs/nfs3proc.c')
-rw-r--r-- | fs/nfs/nfs3proc.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 7143b1f82cea..f8688eaa0001 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -81,7 +81,7 @@ do_proc_get_root(struct rpc_clnt *client, struct nfs_fh *fhandle, | |||
81 | } | 81 | } |
82 | 82 | ||
83 | /* | 83 | /* |
84 | * Bare-bones access to getattr: this is for nfs_read_super. | 84 | * Bare-bones access to getattr: this is for nfs_get_root/nfs_get_sb |
85 | */ | 85 | */ |
86 | static int | 86 | static int |
87 | nfs3_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle, | 87 | nfs3_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle, |
@@ -90,8 +90,8 @@ nfs3_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle, | |||
90 | int status; | 90 | int status; |
91 | 91 | ||
92 | status = do_proc_get_root(server->client, fhandle, info); | 92 | status = do_proc_get_root(server->client, fhandle, info); |
93 | if (status && server->client_sys != server->client) | 93 | if (status && server->nfs_client->cl_rpcclient != server->client) |
94 | status = do_proc_get_root(server->client_sys, fhandle, info); | 94 | status = do_proc_get_root(server->nfs_client->cl_rpcclient, fhandle, info); |
95 | return status; | 95 | return status; |
96 | } | 96 | } |
97 | 97 | ||
@@ -544,23 +544,23 @@ nfs3_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) | |||
544 | } | 544 | } |
545 | 545 | ||
546 | static int | 546 | static int |
547 | nfs3_proc_symlink(struct inode *dir, struct qstr *name, struct qstr *path, | 547 | nfs3_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page, |
548 | struct iattr *sattr, struct nfs_fh *fhandle, | 548 | unsigned int len, struct iattr *sattr) |
549 | struct nfs_fattr *fattr) | ||
550 | { | 549 | { |
551 | struct nfs_fattr dir_attr; | 550 | struct nfs_fh fhandle; |
551 | struct nfs_fattr fattr, dir_attr; | ||
552 | struct nfs3_symlinkargs arg = { | 552 | struct nfs3_symlinkargs arg = { |
553 | .fromfh = NFS_FH(dir), | 553 | .fromfh = NFS_FH(dir), |
554 | .fromname = name->name, | 554 | .fromname = dentry->d_name.name, |
555 | .fromlen = name->len, | 555 | .fromlen = dentry->d_name.len, |
556 | .topath = path->name, | 556 | .pages = &page, |
557 | .tolen = path->len, | 557 | .pathlen = len, |
558 | .sattr = sattr | 558 | .sattr = sattr |
559 | }; | 559 | }; |
560 | struct nfs3_diropres res = { | 560 | struct nfs3_diropres res = { |
561 | .dir_attr = &dir_attr, | 561 | .dir_attr = &dir_attr, |
562 | .fh = fhandle, | 562 | .fh = &fhandle, |
563 | .fattr = fattr | 563 | .fattr = &fattr |
564 | }; | 564 | }; |
565 | struct rpc_message msg = { | 565 | struct rpc_message msg = { |
566 | .rpc_proc = &nfs3_procedures[NFS3PROC_SYMLINK], | 566 | .rpc_proc = &nfs3_procedures[NFS3PROC_SYMLINK], |
@@ -569,13 +569,19 @@ nfs3_proc_symlink(struct inode *dir, struct qstr *name, struct qstr *path, | |||
569 | }; | 569 | }; |
570 | int status; | 570 | int status; |
571 | 571 | ||
572 | if (path->len > NFS3_MAXPATHLEN) | 572 | if (len > NFS3_MAXPATHLEN) |
573 | return -ENAMETOOLONG; | 573 | return -ENAMETOOLONG; |
574 | dprintk("NFS call symlink %s -> %s\n", name->name, path->name); | 574 | |
575 | dprintk("NFS call symlink %s\n", dentry->d_name.name); | ||
576 | |||
575 | nfs_fattr_init(&dir_attr); | 577 | nfs_fattr_init(&dir_attr); |
576 | nfs_fattr_init(fattr); | 578 | nfs_fattr_init(&fattr); |
577 | status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); | 579 | status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); |
578 | nfs_post_op_update_inode(dir, &dir_attr); | 580 | nfs_post_op_update_inode(dir, &dir_attr); |
581 | if (status != 0) | ||
582 | goto out; | ||
583 | status = nfs_instantiate(dentry, &fhandle, &fattr); | ||
584 | out: | ||
579 | dprintk("NFS reply symlink: %d\n", status); | 585 | dprintk("NFS reply symlink: %d\n", status); |
580 | return status; | 586 | return status; |
581 | } | 587 | } |
@@ -785,7 +791,7 @@ nfs3_proc_fsinfo(struct nfs_server *server, struct nfs_fh *fhandle, | |||
785 | 791 | ||
786 | dprintk("NFS call fsinfo\n"); | 792 | dprintk("NFS call fsinfo\n"); |
787 | nfs_fattr_init(info->fattr); | 793 | nfs_fattr_init(info->fattr); |
788 | status = rpc_call_sync(server->client_sys, &msg, 0); | 794 | status = rpc_call_sync(server->nfs_client->cl_rpcclient, &msg, 0); |
789 | dprintk("NFS reply fsinfo: %d\n", status); | 795 | dprintk("NFS reply fsinfo: %d\n", status); |
790 | return status; | 796 | return status; |
791 | } | 797 | } |
@@ -886,7 +892,7 @@ nfs3_proc_lock(struct file *filp, int cmd, struct file_lock *fl) | |||
886 | return nlmclnt_proc(filp->f_dentry->d_inode, cmd, fl); | 892 | return nlmclnt_proc(filp->f_dentry->d_inode, cmd, fl); |
887 | } | 893 | } |
888 | 894 | ||
889 | struct nfs_rpc_ops nfs_v3_clientops = { | 895 | const struct nfs_rpc_ops nfs_v3_clientops = { |
890 | .version = 3, /* protocol version */ | 896 | .version = 3, /* protocol version */ |
891 | .dentry_ops = &nfs_dentry_operations, | 897 | .dentry_ops = &nfs_dentry_operations, |
892 | .dir_inode_ops = &nfs3_dir_inode_operations, | 898 | .dir_inode_ops = &nfs3_dir_inode_operations, |