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.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index a48a003242c..f5150d71c03 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -111,6 +111,9 @@ nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
111 }; 111 };
112 int status; 112 int status;
113 113
114 /* Mask out the non-modebit related stuff from attr->ia_mode */
115 sattr->ia_mode &= S_IALLUGO;
116
114 dprintk("NFS call setattr\n"); 117 dprintk("NFS call setattr\n");
115 nfs_fattr_init(fattr); 118 nfs_fattr_init(fattr);
116 status = rpc_call(NFS_CLIENT(inode), NFSPROC_SETATTR, &arg, fattr, 0); 119 status = rpc_call(NFS_CLIENT(inode), NFSPROC_SETATTR, &arg, fattr, 0);
@@ -375,6 +378,7 @@ nfs_proc_link(struct inode *inode, struct inode *dir, struct qstr *name)
375 378
376 dprintk("NFS call link %s\n", name->name); 379 dprintk("NFS call link %s\n", name->name);
377 status = rpc_call(NFS_CLIENT(inode), NFSPROC_LINK, &arg, NULL, 0); 380 status = rpc_call(NFS_CLIENT(inode), NFSPROC_LINK, &arg, NULL, 0);
381 nfs_mark_for_revalidate(inode);
378 nfs_mark_for_revalidate(dir); 382 nfs_mark_for_revalidate(dir);
379 dprintk("NFS reply link: %d\n", status); 383 dprintk("NFS reply link: %d\n", status);
380 return status; 384 return status;
@@ -546,10 +550,9 @@ nfs_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
546 550
547extern u32 * nfs_decode_dirent(u32 *, struct nfs_entry *, int); 551extern u32 * nfs_decode_dirent(u32 *, struct nfs_entry *, int);
548 552
549static void 553static void nfs_read_done(struct rpc_task *task, void *calldata)
550nfs_read_done(struct rpc_task *task)
551{ 554{
552 struct nfs_read_data *data = (struct nfs_read_data *) task->tk_calldata; 555 struct nfs_read_data *data = calldata;
553 556
554 if (task->tk_status >= 0) { 557 if (task->tk_status >= 0) {
555 nfs_refresh_inode(data->inode, data->res.fattr); 558 nfs_refresh_inode(data->inode, data->res.fattr);
@@ -559,9 +562,14 @@ nfs_read_done(struct rpc_task *task)
559 if (data->args.offset + data->args.count >= data->res.fattr->size) 562 if (data->args.offset + data->args.count >= data->res.fattr->size)
560 data->res.eof = 1; 563 data->res.eof = 1;
561 } 564 }
562 nfs_readpage_result(task); 565 nfs_readpage_result(task, calldata);
563} 566}
564 567
568static const struct rpc_call_ops nfs_read_ops = {
569 .rpc_call_done = nfs_read_done,
570 .rpc_release = nfs_readdata_release,
571};
572
565static void 573static void
566nfs_proc_read_setup(struct nfs_read_data *data) 574nfs_proc_read_setup(struct nfs_read_data *data)
567{ 575{
@@ -579,20 +587,24 @@ nfs_proc_read_setup(struct nfs_read_data *data)
579 flags = RPC_TASK_ASYNC | (IS_SWAPFILE(inode)? NFS_RPC_SWAPFLAGS : 0); 587 flags = RPC_TASK_ASYNC | (IS_SWAPFILE(inode)? NFS_RPC_SWAPFLAGS : 0);
580 588
581 /* Finalize the task. */ 589 /* Finalize the task. */
582 rpc_init_task(task, NFS_CLIENT(inode), nfs_read_done, flags); 590 rpc_init_task(task, NFS_CLIENT(inode), flags, &nfs_read_ops, data);
583 rpc_call_setup(task, &msg, 0); 591 rpc_call_setup(task, &msg, 0);
584} 592}
585 593
586static void 594static void nfs_write_done(struct rpc_task *task, void *calldata)
587nfs_write_done(struct rpc_task *task)
588{ 595{
589 struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata; 596 struct nfs_write_data *data = calldata;
590 597
591 if (task->tk_status >= 0) 598 if (task->tk_status >= 0)
592 nfs_post_op_update_inode(data->inode, data->res.fattr); 599 nfs_post_op_update_inode(data->inode, data->res.fattr);
593 nfs_writeback_done(task); 600 nfs_writeback_done(task, calldata);
594} 601}
595 602
603static const struct rpc_call_ops nfs_write_ops = {
604 .rpc_call_done = nfs_write_done,
605 .rpc_release = nfs_writedata_release,
606};
607
596static void 608static void
597nfs_proc_write_setup(struct nfs_write_data *data, int how) 609nfs_proc_write_setup(struct nfs_write_data *data, int how)
598{ 610{
@@ -613,7 +625,7 @@ nfs_proc_write_setup(struct nfs_write_data *data, int how)
613 flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC; 625 flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC;
614 626
615 /* Finalize the task. */ 627 /* Finalize the task. */
616 rpc_init_task(task, NFS_CLIENT(inode), nfs_write_done, flags); 628 rpc_init_task(task, NFS_CLIENT(inode), flags, &nfs_write_ops, data);
617 rpc_call_setup(task, &msg, 0); 629 rpc_call_setup(task, &msg, 0);
618} 630}
619 631