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.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index e1e3ca5d746b..f5150d71c03d 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);
@@ -547,10 +550,9 @@ nfs_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
547 550
548extern u32 * nfs_decode_dirent(u32 *, struct nfs_entry *, int); 551extern u32 * nfs_decode_dirent(u32 *, struct nfs_entry *, int);
549 552
550static void 553static void nfs_read_done(struct rpc_task *task, void *calldata)
551nfs_read_done(struct rpc_task *task)
552{ 554{
553 struct nfs_read_data *data = (struct nfs_read_data *) task->tk_calldata; 555 struct nfs_read_data *data = calldata;
554 556
555 if (task->tk_status >= 0) { 557 if (task->tk_status >= 0) {
556 nfs_refresh_inode(data->inode, data->res.fattr); 558 nfs_refresh_inode(data->inode, data->res.fattr);
@@ -560,9 +562,14 @@ nfs_read_done(struct rpc_task *task)
560 if (data->args.offset + data->args.count >= data->res.fattr->size) 562 if (data->args.offset + data->args.count >= data->res.fattr->size)
561 data->res.eof = 1; 563 data->res.eof = 1;
562 } 564 }
563 nfs_readpage_result(task); 565 nfs_readpage_result(task, calldata);
564} 566}
565 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
566static void 573static void
567nfs_proc_read_setup(struct nfs_read_data *data) 574nfs_proc_read_setup(struct nfs_read_data *data)
568{ 575{
@@ -580,20 +587,24 @@ nfs_proc_read_setup(struct nfs_read_data *data)
580 flags = RPC_TASK_ASYNC | (IS_SWAPFILE(inode)? NFS_RPC_SWAPFLAGS : 0); 587 flags = RPC_TASK_ASYNC | (IS_SWAPFILE(inode)? NFS_RPC_SWAPFLAGS : 0);
581 588
582 /* Finalize the task. */ 589 /* Finalize the task. */
583 rpc_init_task(task, NFS_CLIENT(inode), nfs_read_done, flags); 590 rpc_init_task(task, NFS_CLIENT(inode), flags, &nfs_read_ops, data);
584 rpc_call_setup(task, &msg, 0); 591 rpc_call_setup(task, &msg, 0);
585} 592}
586 593
587static void 594static void nfs_write_done(struct rpc_task *task, void *calldata)
588nfs_write_done(struct rpc_task *task)
589{ 595{
590 struct nfs_write_data *data = (struct nfs_write_data *) task->tk_calldata; 596 struct nfs_write_data *data = calldata;
591 597
592 if (task->tk_status >= 0) 598 if (task->tk_status >= 0)
593 nfs_post_op_update_inode(data->inode, data->res.fattr); 599 nfs_post_op_update_inode(data->inode, data->res.fattr);
594 nfs_writeback_done(task); 600 nfs_writeback_done(task, calldata);
595} 601}
596 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
597static void 608static void
598nfs_proc_write_setup(struct nfs_write_data *data, int how) 609nfs_proc_write_setup(struct nfs_write_data *data, int how)
599{ 610{
@@ -614,7 +625,7 @@ nfs_proc_write_setup(struct nfs_write_data *data, int how)
614 flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC; 625 flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC;
615 626
616 /* Finalize the task. */ 627 /* Finalize the task. */
617 rpc_init_task(task, NFS_CLIENT(inode), nfs_write_done, flags); 628 rpc_init_task(task, NFS_CLIENT(inode), flags, &nfs_write_ops, data);
618 rpc_call_setup(task, &msg, 0); 629 rpc_call_setup(task, &msg, 0);
619} 630}
620 631