aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/proc.c')
-rw-r--r--fs/nfs/proc.c43
1 files changed, 28 insertions, 15 deletions
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index b3899ea3229e..4529cc4f3f8f 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -66,14 +66,14 @@ nfs_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle,
66 66
67 dprintk("%s: call getattr\n", __FUNCTION__); 67 dprintk("%s: call getattr\n", __FUNCTION__);
68 nfs_fattr_init(fattr); 68 nfs_fattr_init(fattr);
69 status = rpc_call_sync(server->client_sys, &msg, 0); 69 status = rpc_call_sync(server->nfs_client->cl_rpcclient, &msg, 0);
70 dprintk("%s: reply getattr: %d\n", __FUNCTION__, status); 70 dprintk("%s: reply getattr: %d\n", __FUNCTION__, status);
71 if (status) 71 if (status)
72 return status; 72 return status;
73 dprintk("%s: call statfs\n", __FUNCTION__); 73 dprintk("%s: call statfs\n", __FUNCTION__);
74 msg.rpc_proc = &nfs_procedures[NFSPROC_STATFS]; 74 msg.rpc_proc = &nfs_procedures[NFSPROC_STATFS];
75 msg.rpc_resp = &fsinfo; 75 msg.rpc_resp = &fsinfo;
76 status = rpc_call_sync(server->client_sys, &msg, 0); 76 status = rpc_call_sync(server->nfs_client->cl_rpcclient, &msg, 0);
77 dprintk("%s: reply statfs: %d\n", __FUNCTION__, status); 77 dprintk("%s: reply statfs: %d\n", __FUNCTION__, status);
78 if (status) 78 if (status)
79 return status; 79 return status;
@@ -352,7 +352,7 @@ nfs_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *
352{ 352{
353 struct nfs_diropargs *arg; 353 struct nfs_diropargs *arg;
354 354
355 arg = (struct nfs_diropargs *)kmalloc(sizeof(*arg), GFP_KERNEL); 355 arg = kmalloc(sizeof(*arg), GFP_KERNEL);
356 if (!arg) 356 if (!arg)
357 return -ENOMEM; 357 return -ENOMEM;
358 arg->fh = NFS_FH(dir->d_inode); 358 arg->fh = NFS_FH(dir->d_inode);
@@ -425,16 +425,17 @@ nfs_proc_link(struct inode *inode, struct inode *dir, struct qstr *name)
425} 425}
426 426
427static int 427static int
428nfs_proc_symlink(struct inode *dir, struct qstr *name, struct qstr *path, 428nfs_proc_symlink(struct inode *dir, struct dentry *dentry, struct page *page,
429 struct iattr *sattr, struct nfs_fh *fhandle, 429 unsigned int len, struct iattr *sattr)
430 struct nfs_fattr *fattr)
431{ 430{
431 struct nfs_fh fhandle;
432 struct nfs_fattr fattr;
432 struct nfs_symlinkargs arg = { 433 struct nfs_symlinkargs arg = {
433 .fromfh = NFS_FH(dir), 434 .fromfh = NFS_FH(dir),
434 .fromname = name->name, 435 .fromname = dentry->d_name.name,
435 .fromlen = name->len, 436 .fromlen = dentry->d_name.len,
436 .topath = path->name, 437 .pages = &page,
437 .tolen = path->len, 438 .pathlen = len,
438 .sattr = sattr 439 .sattr = sattr
439 }; 440 };
440 struct rpc_message msg = { 441 struct rpc_message msg = {
@@ -443,13 +444,25 @@ nfs_proc_symlink(struct inode *dir, struct qstr *name, struct qstr *path,
443 }; 444 };
444 int status; 445 int status;
445 446
446 if (path->len > NFS2_MAXPATHLEN) 447 if (len > NFS2_MAXPATHLEN)
447 return -ENAMETOOLONG; 448 return -ENAMETOOLONG;
448 dprintk("NFS call symlink %s -> %s\n", name->name, path->name); 449
449 nfs_fattr_init(fattr); 450 dprintk("NFS call symlink %s\n", dentry->d_name.name);
450 fhandle->size = 0; 451
451 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0); 452 status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
452 nfs_mark_for_revalidate(dir); 453 nfs_mark_for_revalidate(dir);
454
455 /*
456 * V2 SYMLINK requests don't return any attributes. Setting the
457 * filehandle size to zero indicates to nfs_instantiate that it
458 * should fill in the data with a LOOKUP call on the wire.
459 */
460 if (status == 0) {
461 nfs_fattr_init(&fattr);
462 fhandle.size = 0;
463 status = nfs_instantiate(dentry, &fhandle, &fattr);
464 }
465
453 dprintk("NFS reply symlink: %d\n", status); 466 dprintk("NFS reply symlink: %d\n", status);
454 return status; 467 return status;
455} 468}
@@ -671,7 +684,7 @@ nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl)
671} 684}
672 685
673 686
674struct nfs_rpc_ops nfs_v2_clientops = { 687const struct nfs_rpc_ops nfs_v2_clientops = {
675 .version = 2, /* protocol version */ 688 .version = 2, /* protocol version */
676 .dentry_ops = &nfs_dentry_operations, 689 .dentry_ops = &nfs_dentry_operations,
677 .dir_inode_ops = &nfs_dir_inode_operations, 690 .dir_inode_ops = &nfs_dir_inode_operations,