2 * linux/fs/nfs/nfs3proc.c
4 * Client-side NFSv3 procedures stubs.
6 * Copyright (C) 1997, Olaf Kirch
10 #include <linux/utsname.h>
11 #include <linux/errno.h>
12 #include <linux/string.h>
13 #include <linux/sunrpc/clnt.h>
14 #include <linux/nfs.h>
15 #include <linux/nfs3.h>
16 #include <linux/nfs_fs.h>
17 #include <linux/nfs_page.h>
18 #include <linux/smp_lock.h>
20 #define NFSDBG_FACILITY NFSDBG_PROC
22 extern struct rpc_procinfo nfs3_procedures
[];
24 /* A wrapper to handle the EJUKEBOX error message */
26 nfs3_rpc_wrapper(struct rpc_clnt
*clnt
, struct rpc_message
*msg
, int flags
)
30 rpc_clnt_sigmask(clnt
, &oldset
);
32 res
= rpc_call_sync(clnt
, msg
, flags
);
35 set_current_state(TASK_INTERRUPTIBLE
);
36 schedule_timeout(NFS_JUKEBOX_RETRY_TIME
);
38 } while (!signalled());
39 rpc_clnt_sigunmask(clnt
, &oldset
);
44 nfs3_rpc_call_wrapper(struct rpc_clnt
*clnt
, u32 proc
, void *argp
, void *resp
, int flags
)
46 struct rpc_message msg
= {
47 .rpc_proc
= &nfs3_procedures
[proc
],
51 return nfs3_rpc_wrapper(clnt
, &msg
, flags
);
54 #define rpc_call(clnt, proc, argp, resp, flags) \
55 nfs3_rpc_call_wrapper(clnt, proc, argp, resp, flags)
56 #define rpc_call_sync(clnt, msg, flags) \
57 nfs3_rpc_wrapper(clnt, msg, flags)
60 nfs3_async_handle_jukebox(struct rpc_task
*task
)
62 if (task
->tk_status
!= -EJUKEBOX
)
65 rpc_restart_call(task
);
66 rpc_delay(task
, NFS_JUKEBOX_RETRY_TIME
);
71 * Bare-bones access to getattr: this is for nfs_read_super.
74 nfs3_proc_get_root(struct nfs_server
*server
, struct nfs_fh
*fhandle
,
75 struct nfs_fattr
*fattr
)
79 dprintk("NFS call getroot\n");
81 status
= rpc_call(server
->client
, NFS3PROC_GETATTR
, fhandle
, fattr
, 0);
82 dprintk("NFS reply getroot\n");
87 * One function for each procedure in the NFS protocol.
90 nfs3_proc_getattr(struct inode
*inode
, struct nfs_fattr
*fattr
)
94 dprintk("NFS call getattr\n");
96 status
= rpc_call(NFS_CLIENT(inode
), NFS3PROC_GETATTR
,
97 NFS_FH(inode
), fattr
, 0);
98 dprintk("NFS reply getattr\n");
103 nfs3_proc_setattr(struct dentry
*dentry
, struct nfs_fattr
*fattr
,
106 struct inode
*inode
= dentry
->d_inode
;
107 struct nfs3_sattrargs arg
= {
113 dprintk("NFS call setattr\n");
115 status
= rpc_call(NFS_CLIENT(inode
), NFS3PROC_SETATTR
, &arg
, fattr
, 0);
116 dprintk("NFS reply setattr\n");
121 nfs3_proc_lookup(struct inode
*dir
, struct qstr
*name
,
122 struct nfs_fh
*fhandle
, struct nfs_fattr
*fattr
)
124 struct nfs_fattr dir_attr
;
125 struct nfs3_diropargs arg
= {
130 struct nfs3_diropres res
= {
131 .dir_attr
= &dir_attr
,
137 dprintk("NFS call lookup %s\n", name
->name
);
140 status
= rpc_call(NFS_CLIENT(dir
), NFS3PROC_LOOKUP
, &arg
, &res
, 0);
141 if (status
>= 0 && !(fattr
->valid
& NFS_ATTR_FATTR
))
142 status
= rpc_call(NFS_CLIENT(dir
), NFS3PROC_GETATTR
,
144 dprintk("NFS reply lookup: %d\n", status
);
146 status
= nfs_refresh_inode(dir
, &dir_attr
);
151 nfs3_proc_access(struct inode
*inode
, struct rpc_cred
*cred
, int mode
)
153 struct nfs_fattr fattr
;
154 struct nfs3_accessargs arg
= {
157 struct nfs3_accessres res
= {
160 struct rpc_message msg
= {
161 .rpc_proc
= &nfs3_procedures
[NFS3PROC_ACCESS
],
168 dprintk("NFS call access\n");
172 arg
.access
|= NFS3_ACCESS_READ
;
173 if (S_ISDIR(inode
->i_mode
)) {
174 if (mode
& MAY_WRITE
)
175 arg
.access
|= NFS3_ACCESS_MODIFY
| NFS3_ACCESS_EXTEND
| NFS3_ACCESS_DELETE
;
177 arg
.access
|= NFS3_ACCESS_LOOKUP
;
179 if (mode
& MAY_WRITE
)
180 arg
.access
|= NFS3_ACCESS_MODIFY
| NFS3_ACCESS_EXTEND
;
182 arg
.access
|= NFS3_ACCESS_EXECUTE
;
184 status
= rpc_call_sync(NFS_CLIENT(inode
), &msg
, 0);
185 nfs_refresh_inode(inode
, &fattr
);
186 dprintk("NFS reply access\n");
188 if (status
== 0 && (arg
.access
& res
.access
) != arg
.access
)
194 nfs3_proc_readlink(struct inode
*inode
, struct page
*page
)
196 struct nfs_fattr fattr
;
197 struct nfs3_readlinkargs args
= {
199 .count
= PAGE_CACHE_SIZE
,
204 dprintk("NFS call readlink\n");
206 status
= rpc_call(NFS_CLIENT(inode
), NFS3PROC_READLINK
,
208 nfs_refresh_inode(inode
, &fattr
);
209 dprintk("NFS reply readlink: %d\n", status
);
214 nfs3_proc_read(struct inode
*inode
, struct rpc_cred
*cred
,
215 struct nfs_fattr
*fattr
, int flags
,
216 unsigned int base
, unsigned int count
, struct page
*page
,
219 u64 offset
= page_offset(page
) + base
;
220 struct nfs_readargs arg
= {
227 struct nfs_readres res
= {
231 struct rpc_message msg
= {
232 .rpc_proc
= &nfs3_procedures
[NFS3PROC_READ
],
239 dprintk("NFS call read %d @ %Ld\n", count
, (long long)offset
);
241 status
= rpc_call_sync(NFS_CLIENT(inode
), &msg
, flags
);
242 dprintk("NFS reply read: %d\n", status
);
248 nfs3_proc_write(struct inode
*inode
, struct rpc_cred
*cred
,
249 struct nfs_fattr
*fattr
, int flags
,
250 unsigned int base
, unsigned int count
,
251 struct page
*page
, struct nfs_writeverf
*verf
)
253 u64 offset
= page_offset(page
) + base
;
254 struct nfs_writeargs arg
= {
258 .stable
= NFS_FILE_SYNC
,
262 struct nfs_writeres res
= {
266 struct rpc_message msg
= {
267 .rpc_proc
= &nfs3_procedures
[NFS3PROC_WRITE
],
272 int status
, rpcflags
= 0;
274 dprintk("NFS call write %d @ %Ld\n", count
, (long long)offset
);
276 if (flags
& NFS_RW_SWAP
)
277 rpcflags
|= NFS_RPC_SWAPFLAGS
;
278 arg
.stable
= (flags
& NFS_RW_SYNC
) ? NFS_FILE_SYNC
: NFS_UNSTABLE
;
280 status
= rpc_call_sync(NFS_CLIENT(inode
), &msg
, rpcflags
);
282 dprintk("NFS reply read: %d\n", status
);
283 return status
< 0? status
: res
.count
;
287 * Create a regular file.
288 * For now, we don't implement O_EXCL.
291 nfs3_proc_create(struct inode
*dir
, struct qstr
*name
, struct iattr
*sattr
,
292 int flags
, struct nfs_fh
*fhandle
, struct nfs_fattr
*fattr
)
294 struct nfs_fattr dir_attr
;
295 struct nfs3_createargs arg
= {
301 struct nfs3_diropres res
= {
302 .dir_attr
= &dir_attr
,
308 dprintk("NFS call create %s\n", name
->name
);
309 arg
.createmode
= NFS3_CREATE_UNCHECKED
;
310 if (flags
& O_EXCL
) {
311 arg
.createmode
= NFS3_CREATE_EXCLUSIVE
;
312 arg
.verifier
[0] = jiffies
;
313 arg
.verifier
[1] = current
->pid
;
319 status
= rpc_call(NFS_CLIENT(dir
), NFS3PROC_CREATE
, &arg
, &res
, 0);
320 nfs_refresh_inode(dir
, &dir_attr
);
322 /* If the server doesn't support the exclusive creation semantics,
323 * try again with simple 'guarded' mode. */
324 if (status
== NFSERR_NOTSUPP
) {
325 switch (arg
.createmode
) {
326 case NFS3_CREATE_EXCLUSIVE
:
327 arg
.createmode
= NFS3_CREATE_GUARDED
;
330 case NFS3_CREATE_GUARDED
:
331 arg
.createmode
= NFS3_CREATE_UNCHECKED
;
334 case NFS3_CREATE_UNCHECKED
:
341 dprintk("NFS reply create: %d\n", status
);
343 /* When we created the file with exclusive semantics, make
344 * sure we set the attributes afterwards. */
345 if (status
== 0 && arg
.createmode
== NFS3_CREATE_EXCLUSIVE
) {
346 struct nfs3_sattrargs arg
= {
350 dprintk("NFS call setattr (post-create)\n");
352 /* Note: we could use a guarded setattr here, but I'm
353 * not sure this buys us anything (and I'd have
354 * to revamp the NFSv3 XDR code) */
356 status
= rpc_call(NFS_CLIENT(dir
), NFS3PROC_SETATTR
,
358 dprintk("NFS reply setattr (post-create): %d\n", status
);
365 nfs3_proc_remove(struct inode
*dir
, struct qstr
*name
)
367 struct nfs_fattr dir_attr
;
368 struct nfs3_diropargs arg
= {
373 struct rpc_message msg
= {
374 .rpc_proc
= &nfs3_procedures
[NFS3PROC_REMOVE
],
376 .rpc_resp
= &dir_attr
,
380 dprintk("NFS call remove %s\n", name
->name
);
382 status
= rpc_call_sync(NFS_CLIENT(dir
), &msg
, 0);
383 nfs_refresh_inode(dir
, &dir_attr
);
384 dprintk("NFS reply remove: %d\n", status
);
389 nfs3_proc_unlink_setup(struct rpc_message
*msg
, struct dentry
*dir
, struct qstr
*name
)
391 struct nfs3_diropargs
*arg
;
392 struct nfs_fattr
*res
;
394 arg
= (struct nfs3_diropargs
*)kmalloc(sizeof(*arg
)+sizeof(*res
), GFP_KERNEL
);
397 res
= (struct nfs_fattr
*)(arg
+ 1);
398 arg
->fh
= NFS_FH(dir
->d_inode
);
399 arg
->name
= name
->name
;
400 arg
->len
= name
->len
;
402 msg
->rpc_proc
= &nfs3_procedures
[NFS3PROC_REMOVE
];
409 nfs3_proc_unlink_done(struct dentry
*dir
, struct rpc_task
*task
)
411 struct rpc_message
*msg
= &task
->tk_msg
;
412 struct nfs_fattr
*dir_attr
;
414 if (nfs3_async_handle_jukebox(task
))
417 dir_attr
= (struct nfs_fattr
*)msg
->rpc_resp
;
418 nfs_refresh_inode(dir
->d_inode
, dir_attr
);
419 kfree(msg
->rpc_argp
);
425 nfs3_proc_rename(struct inode
*old_dir
, struct qstr
*old_name
,
426 struct inode
*new_dir
, struct qstr
*new_name
)
428 struct nfs_fattr old_dir_attr
, new_dir_attr
;
429 struct nfs3_renameargs arg
= {
430 .fromfh
= NFS_FH(old_dir
),
431 .fromname
= old_name
->name
,
432 .fromlen
= old_name
->len
,
433 .tofh
= NFS_FH(new_dir
),
434 .toname
= new_name
->name
,
435 .tolen
= new_name
->len
437 struct nfs3_renameres res
= {
438 .fromattr
= &old_dir_attr
,
439 .toattr
= &new_dir_attr
443 dprintk("NFS call rename %s -> %s\n", old_name
->name
, new_name
->name
);
444 old_dir_attr
.valid
= 0;
445 new_dir_attr
.valid
= 0;
446 status
= rpc_call(NFS_CLIENT(old_dir
), NFS3PROC_RENAME
, &arg
, &res
, 0);
447 nfs_refresh_inode(old_dir
, &old_dir_attr
);
448 nfs_refresh_inode(new_dir
, &new_dir_attr
);
449 dprintk("NFS reply rename: %d\n", status
);
454 nfs3_proc_link(struct inode
*inode
, struct inode
*dir
, struct qstr
*name
)
456 struct nfs_fattr dir_attr
, fattr
;
457 struct nfs3_linkargs arg
= {
458 .fromfh
= NFS_FH(inode
),
460 .toname
= name
->name
,
463 struct nfs3_linkres res
= {
464 .dir_attr
= &dir_attr
,
469 dprintk("NFS call link %s\n", name
->name
);
472 status
= rpc_call(NFS_CLIENT(inode
), NFS3PROC_LINK
, &arg
, &res
, 0);
473 nfs_refresh_inode(dir
, &dir_attr
);
474 nfs_refresh_inode(inode
, &fattr
);
475 dprintk("NFS reply link: %d\n", status
);
480 nfs3_proc_symlink(struct inode
*dir
, struct qstr
*name
, struct qstr
*path
,
481 struct iattr
*sattr
, struct nfs_fh
*fhandle
,
482 struct nfs_fattr
*fattr
)
484 struct nfs_fattr dir_attr
;
485 struct nfs3_symlinkargs arg
= {
486 .fromfh
= NFS_FH(dir
),
487 .fromname
= name
->name
,
488 .fromlen
= name
->len
,
489 .topath
= path
->name
,
493 struct nfs3_diropres res
= {
494 .dir_attr
= &dir_attr
,
500 dprintk("NFS call symlink %s -> %s\n", name
->name
, path
->name
);
503 status
= rpc_call(NFS_CLIENT(dir
), NFS3PROC_SYMLINK
, &arg
, &res
, 0);
504 nfs_refresh_inode(dir
, &dir_attr
);
505 dprintk("NFS reply symlink: %d\n", status
);
510 nfs3_proc_mkdir(struct inode
*dir
, struct qstr
*name
, struct iattr
*sattr
,
511 struct nfs_fh
*fhandle
, struct nfs_fattr
*fattr
)
513 struct nfs_fattr dir_attr
;
514 struct nfs3_mkdirargs arg
= {
520 struct nfs3_diropres res
= {
521 .dir_attr
= &dir_attr
,
527 dprintk("NFS call mkdir %s\n", name
->name
);
530 status
= rpc_call(NFS_CLIENT(dir
), NFS3PROC_MKDIR
, &arg
, &res
, 0);
531 nfs_refresh_inode(dir
, &dir_attr
);
532 dprintk("NFS reply mkdir: %d\n", status
);
537 nfs3_proc_rmdir(struct inode
*dir
, struct qstr
*name
)
539 struct nfs_fattr dir_attr
;
540 struct nfs3_diropargs arg
= {
547 dprintk("NFS call rmdir %s\n", name
->name
);
549 status
= rpc_call(NFS_CLIENT(dir
), NFS3PROC_RMDIR
, &arg
, &dir_attr
, 0);
550 nfs_refresh_inode(dir
, &dir_attr
);
551 dprintk("NFS reply rmdir: %d\n", status
);
556 * The READDIR implementation is somewhat hackish - we pass the user buffer
557 * to the encode function, which installs it in the receive iovec.
558 * The decode function itself doesn't perform any decoding, it just makes
559 * sure the reply is syntactically correct.
561 * Also note that this implementation handles both plain readdir and
565 nfs3_proc_readdir(struct dentry
*dentry
, struct rpc_cred
*cred
,
566 u64 cookie
, struct page
*page
, unsigned int count
, int plus
)
568 struct inode
*dir
= dentry
->d_inode
;
569 struct nfs_fattr dir_attr
;
570 u32
*verf
= NFS_COOKIEVERF(dir
);
571 struct nfs3_readdirargs arg
= {
574 .verf
= {verf
[0], verf
[1]},
579 struct nfs3_readdirres res
= {
580 .dir_attr
= &dir_attr
,
584 struct rpc_message msg
= {
585 .rpc_proc
= &nfs3_procedures
[NFS3PROC_READDIR
],
595 msg
.rpc_proc
= &nfs3_procedures
[NFS3PROC_READDIRPLUS
];
597 dprintk("NFS call readdir%s %d\n",
598 plus
? "plus" : "", (unsigned int) cookie
);
601 status
= rpc_call_sync(NFS_CLIENT(dir
), &msg
, 0);
602 nfs_refresh_inode(dir
, &dir_attr
);
603 dprintk("NFS reply readdir: %d\n", status
);
609 nfs3_proc_mknod(struct inode
*dir
, struct qstr
*name
, struct iattr
*sattr
,
610 dev_t rdev
, struct nfs_fh
*fh
, struct nfs_fattr
*fattr
)
612 struct nfs_fattr dir_attr
;
613 struct nfs3_mknodargs arg
= {
620 struct nfs3_diropres res
= {
621 .dir_attr
= &dir_attr
,
627 switch (sattr
->ia_mode
& S_IFMT
) {
628 case S_IFBLK
: arg
.type
= NF3BLK
; break;
629 case S_IFCHR
: arg
.type
= NF3CHR
; break;
630 case S_IFIFO
: arg
.type
= NF3FIFO
; break;
631 case S_IFSOCK
: arg
.type
= NF3SOCK
; break;
632 default: return -EINVAL
;
635 dprintk("NFS call mknod %s %x\n", name
->name
, rdev
);
638 status
= rpc_call(NFS_CLIENT(dir
), NFS3PROC_MKNOD
, &arg
, &res
, 0);
639 nfs_refresh_inode(dir
, &dir_attr
);
640 dprintk("NFS reply mknod: %d\n", status
);
645 nfs3_proc_statfs(struct nfs_server
*server
, struct nfs_fh
*fhandle
,
646 struct nfs_fsstat
*stat
)
650 dprintk("NFS call fsstat\n");
651 stat
->fattr
->valid
= 0;
652 status
= rpc_call(server
->client
, NFS3PROC_FSSTAT
, fhandle
, stat
, 0);
653 dprintk("NFS reply statfs: %d\n", status
);
658 nfs3_proc_fsinfo(struct nfs_server
*server
, struct nfs_fh
*fhandle
,
659 struct nfs_fsinfo
*info
)
663 dprintk("NFS call fsinfo\n");
664 info
->fattr
->valid
= 0;
665 status
= rpc_call(server
->client
, NFS3PROC_FSINFO
, fhandle
, info
, 0);
666 dprintk("NFS reply fsinfo: %d\n", status
);
671 nfs3_proc_pathconf(struct nfs_server
*server
, struct nfs_fh
*fhandle
,
672 struct nfs_pathconf
*info
)
676 dprintk("NFS call pathconf\n");
677 info
->fattr
->valid
= 0;
678 status
= rpc_call(server
->client
, NFS3PROC_PATHCONF
, fhandle
, info
, 0);
679 dprintk("NFS reply pathconf: %d\n", status
);
683 extern u32
*nfs3_decode_dirent(u32
*, struct nfs_entry
*, int);
686 nfs3_read_done(struct rpc_task
*task
)
688 struct nfs_read_data
*data
= (struct nfs_read_data
*) task
->tk_calldata
;
690 if (nfs3_async_handle_jukebox(task
))
692 nfs_readpage_result(task
, data
->u
.v3
.res
.count
, data
->u
.v3
.res
.eof
);
696 nfs3_proc_read_setup(struct nfs_read_data
*data
, unsigned int count
)
698 struct rpc_task
*task
= &data
->task
;
699 struct inode
*inode
= data
->inode
;
700 struct nfs_page
*req
;
702 struct rpc_message msg
= {
703 .rpc_proc
= &nfs3_procedures
[NFS3PROC_READ
],
704 .rpc_argp
= &data
->u
.v3
.args
,
705 .rpc_resp
= &data
->u
.v3
.res
,
706 .rpc_cred
= data
->cred
,
709 req
= nfs_list_entry(data
->pages
.next
);
710 data
->u
.v3
.args
.fh
= NFS_FH(inode
);
711 data
->u
.v3
.args
.offset
= req_offset(req
) + req
->wb_offset
;
712 data
->u
.v3
.args
.pgbase
= req
->wb_offset
;
713 data
->u
.v3
.args
.pages
= data
->pagevec
;
714 data
->u
.v3
.args
.count
= count
;
715 data
->u
.v3
.res
.fattr
= &data
->fattr
;
716 data
->u
.v3
.res
.count
= count
;
717 data
->u
.v3
.res
.eof
= 0;
719 /* N.B. Do we need to test? Never called for swapfile inode */
720 flags
= RPC_TASK_ASYNC
| (IS_SWAPFILE(inode
)? NFS_RPC_SWAPFLAGS
: 0);
722 /* Finalize the task. */
723 rpc_init_task(task
, NFS_CLIENT(inode
), nfs3_read_done
, flags
);
724 task
->tk_calldata
= data
;
725 /* Release requests */
726 task
->tk_release
= nfs_readdata_release
;
728 rpc_call_setup(&data
->task
, &msg
, 0);
732 nfs3_write_done(struct rpc_task
*task
)
734 struct nfs_write_data
*data
= (struct nfs_write_data
*) task
->tk_calldata
;
736 if (nfs3_async_handle_jukebox(task
))
738 nfs_writeback_done(task
, data
->u
.v3
.args
.stable
,
739 data
->u
.v3
.args
.count
, data
->u
.v3
.res
.count
);
743 nfs3_proc_write_setup(struct nfs_write_data
*data
, unsigned int count
, int how
)
745 struct rpc_task
*task
= &data
->task
;
746 struct inode
*inode
= data
->inode
;
747 struct nfs_page
*req
;
750 struct rpc_message msg
= {
751 .rpc_proc
= &nfs3_procedures
[NFS3PROC_WRITE
],
752 .rpc_argp
= &data
->u
.v3
.args
,
753 .rpc_resp
= &data
->u
.v3
.res
,
754 .rpc_cred
= data
->cred
,
757 if (how
& FLUSH_STABLE
) {
758 if (!NFS_I(inode
)->ncommit
)
759 stable
= NFS_FILE_SYNC
;
761 stable
= NFS_DATA_SYNC
;
763 stable
= NFS_UNSTABLE
;
765 req
= nfs_list_entry(data
->pages
.next
);
766 data
->u
.v3
.args
.fh
= NFS_FH(inode
);
767 data
->u
.v3
.args
.offset
= req_offset(req
) + req
->wb_offset
;
768 data
->u
.v3
.args
.pgbase
= req
->wb_offset
;
769 data
->u
.v3
.args
.count
= count
;
770 data
->u
.v3
.args
.stable
= stable
;
771 data
->u
.v3
.args
.pages
= data
->pagevec
;
772 data
->u
.v3
.res
.fattr
= &data
->fattr
;
773 data
->u
.v3
.res
.count
= count
;
774 data
->u
.v3
.res
.verf
= &data
->verf
;
776 /* Set the initial flags for the task. */
777 flags
= (how
& FLUSH_SYNC
) ? 0 : RPC_TASK_ASYNC
;
779 /* Finalize the task. */
780 rpc_init_task(task
, NFS_CLIENT(inode
), nfs3_write_done
, flags
);
781 task
->tk_calldata
= data
;
782 /* Release requests */
783 task
->tk_release
= nfs_writedata_release
;
785 rpc_call_setup(&data
->task
, &msg
, 0);
789 nfs3_commit_done(struct rpc_task
*task
)
791 if (nfs3_async_handle_jukebox(task
))
793 nfs_commit_done(task
);
797 nfs3_proc_commit_setup(struct nfs_write_data
*data
, u64 start
, u32 len
, int how
)
799 struct rpc_task
*task
= &data
->task
;
800 struct inode
*inode
= data
->inode
;
802 struct rpc_message msg
= {
803 .rpc_proc
= &nfs3_procedures
[NFS3PROC_COMMIT
],
804 .rpc_argp
= &data
->u
.v3
.args
,
805 .rpc_resp
= &data
->u
.v3
.res
,
806 .rpc_cred
= data
->cred
,
809 data
->u
.v3
.args
.fh
= NFS_FH(data
->inode
);
810 data
->u
.v3
.args
.offset
= start
;
811 data
->u
.v3
.args
.count
= len
;
812 data
->u
.v3
.res
.count
= len
;
813 data
->u
.v3
.res
.fattr
= &data
->fattr
;
814 data
->u
.v3
.res
.verf
= &data
->verf
;
816 /* Set the initial flags for the task. */
817 flags
= (how
& FLUSH_SYNC
) ? 0 : RPC_TASK_ASYNC
;
819 /* Finalize the task. */
820 rpc_init_task(task
, NFS_CLIENT(inode
), nfs3_commit_done
, flags
);
821 task
->tk_calldata
= data
;
822 /* Release requests */
823 task
->tk_release
= nfs_commit_release
;
825 rpc_call_setup(&data
->task
, &msg
, 0);
828 struct nfs_rpc_ops nfs_v3_clientops
= {
829 .version
= 3, /* protocol version */
830 .getroot
= nfs3_proc_get_root
,
831 .getattr
= nfs3_proc_getattr
,
832 .setattr
= nfs3_proc_setattr
,
833 .lookup
= nfs3_proc_lookup
,
834 .access
= nfs3_proc_access
,
835 .readlink
= nfs3_proc_readlink
,
836 .read
= nfs3_proc_read
,
837 .write
= nfs3_proc_write
,
838 .create
= nfs3_proc_create
,
839 .remove
= nfs3_proc_remove
,
840 .unlink_setup
= nfs3_proc_unlink_setup
,
841 .unlink_done
= nfs3_proc_unlink_done
,
842 .rename
= nfs3_proc_rename
,
843 .link
= nfs3_proc_link
,
844 .symlink
= nfs3_proc_symlink
,
845 .mkdir
= nfs3_proc_mkdir
,
846 .rmdir
= nfs3_proc_rmdir
,
847 .readdir
= nfs3_proc_readdir
,
848 .mknod
= nfs3_proc_mknod
,
849 .statfs
= nfs3_proc_statfs
,
850 .fsinfo
= nfs3_proc_fsinfo
,
851 .pathconf
= nfs3_proc_pathconf
,
852 .decode_dirent
= nfs3_decode_dirent
,
853 .read_setup
= nfs3_proc_read_setup
,
854 .write_setup
= nfs3_proc_write_setup
,
855 .commit_setup
= nfs3_proc_commit_setup
,