1 #ifndef _LINUX_NFS_XDR_H
2 #define _LINUX_NFS_XDR_H
5 unsigned short valid; /* which fields are valid */
6 __u64 pre_size; /* pre_op_attr.size */
7 __u64 pre_mtime; /* pre_op_attr.mtime */
8 __u64 pre_ctime; /* pre_op_attr.ctime */
9 enum nfs_ftype type; /* always use NFSv2 types */
32 #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */
33 #define NFS_ATTR_FATTR 0x0002 /* post-op attributes */
34 #define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */
37 * Info on the file system
40 __u32 rtmax; /* max. read transfer size */
41 __u32 rtpref; /* pref. read transfer size */
42 __u32 rtmult; /* reads should be multiple of this */
43 __u32 wtmax; /* max. write transfer size */
44 __u32 wtpref; /* pref. write transfer size */
45 __u32 wtmult; /* writes should be multiple of this */
46 __u32 dtpref; /* pref. readdir transfer size */
48 __u64 bsize; /* block size */
49 __u64 tbytes; /* total size in bytes */
50 __u64 fbytes; /* # of free bytes */
51 __u64 abytes; /* # of bytes available to user */
52 __u64 tfiles; /* # of files */
53 __u64 ffiles; /* # of free files */
54 __u64 afiles; /* # of files available to user */
55 __u32 linkmax;/* max # of hard links */
56 __u32 namelen;/* max name length */
59 /* Arguments to the read call.
60 * Note that NFS_READ_MAXIOV must be <= (MAX_IOVEC-2) from sunrpc/xprt.h
62 #define NFS_READ_MAXIOV (9)
73 struct nfs_fattr * fattr;
78 /* Arguments to the write call.
79 * Note that NFS_WRITE_MAXIOV must be <= (MAX_IOVEC-2) from sunrpc/xprt.h
81 #define NFS_WRITE_MAXIOV (9)
82 struct nfs_writeargs {
86 enum nfs3_stable_how stable;
91 struct nfs_writeverf {
92 enum nfs3_stable_how committed;
97 struct nfs_fattr * fattr;
98 struct nfs_writeverf * verf;
103 * Argument struct for decode_entry function
115 * The following types are for NFSv2 only.
117 struct nfs_sattrargs {
119 struct iattr * sattr;
122 struct nfs_diropargs {
128 struct nfs_createargs {
132 struct iattr * sattr;
135 struct nfs_renameargs {
136 struct nfs_fh * fromfh;
137 const char * fromname;
138 unsigned int fromlen;
139 struct nfs_fh * tofh;
144 struct nfs_linkargs {
145 struct nfs_fh * fromfh;
146 struct nfs_fh * tofh;
151 struct nfs_symlinkargs {
152 struct nfs_fh * fromfh;
153 const char * fromname;
154 unsigned int fromlen;
157 struct iattr * sattr;
160 struct nfs_readdirargs {
164 struct page ** pages;
169 struct nfs_fattr * fattr;
172 struct nfs_readlinkargs {
175 struct page ** pages;
178 struct nfs3_sattrargs {
180 struct iattr * sattr;
185 struct nfs3_diropargs {
191 struct nfs3_accessargs {
196 struct nfs3_createargs {
200 struct iattr * sattr;
201 enum nfs3_createmode createmode;
205 struct nfs3_mkdirargs {
209 struct iattr * sattr;
212 struct nfs3_symlinkargs {
213 struct nfs_fh * fromfh;
214 const char * fromname;
215 unsigned int fromlen;
218 struct iattr * sattr;
221 struct nfs3_mknodargs {
225 enum nfs3_ftype type;
226 struct iattr * sattr;
230 struct nfs3_renameargs {
231 struct nfs_fh * fromfh;
232 const char * fromname;
233 unsigned int fromlen;
234 struct nfs_fh * tofh;
239 struct nfs3_linkargs {
240 struct nfs_fh * fromfh;
241 struct nfs_fh * tofh;
246 struct nfs3_readdirargs {
252 struct page ** pages;
255 struct nfs3_diropres {
256 struct nfs_fattr * dir_attr;
258 struct nfs_fattr * fattr;
261 struct nfs3_accessres {
262 struct nfs_fattr * fattr;
266 struct nfs3_readlinkargs {
269 struct page ** pages;
272 struct nfs3_renameres {
273 struct nfs_fattr * fromattr;
274 struct nfs_fattr * toattr;
277 struct nfs3_linkres {
278 struct nfs_fattr * dir_attr;
279 struct nfs_fattr * fattr;
282 struct nfs3_readdirres {
283 struct nfs_fattr * dir_attr;
289 * RPC procedure vector for NFSv2/NFSv3 demuxing
292 int version; /* Protocol version */
294 int (*getroot) (struct nfs_server *, struct nfs_fh *,
296 int (*getattr) (struct inode *, struct nfs_fattr *);
297 int (*setattr) (struct inode *, struct nfs_fattr *,
299 int (*lookup) (struct inode *, struct qstr *,
300 struct nfs_fh *, struct nfs_fattr *);
301 int (*access) (struct inode *, int , int);
302 int (*readlink)(struct inode *, struct page *);
303 int (*read) (struct inode *, struct rpc_cred *,
305 int, unsigned int, unsigned int,
306 struct page *, int *eofp);
307 int (*write) (struct inode *, struct rpc_cred *,
309 int, unsigned int, unsigned int,
310 struct page *, struct nfs_writeverf *verfp);
311 int (*commit) (struct inode *, struct nfs_fattr *,
312 unsigned long, unsigned int);
313 int (*create) (struct inode *, struct qstr *, struct iattr *,
314 int, struct nfs_fh *, struct nfs_fattr *);
315 int (*remove) (struct inode *, struct qstr *);
316 int (*unlink_setup) (struct rpc_message *,
317 struct dentry *, struct qstr *);
318 void (*unlink_done) (struct dentry *, struct rpc_message *);
319 int (*rename) (struct inode *, struct qstr *,
320 struct inode *, struct qstr *);
321 int (*link) (struct inode *, struct inode *, struct qstr *);
322 int (*symlink) (struct inode *, struct qstr *, struct qstr *,
323 struct iattr *, struct nfs_fh *,
325 int (*mkdir) (struct inode *, struct qstr *, struct iattr *,
326 struct nfs_fh *, struct nfs_fattr *);
327 int (*rmdir) (struct inode *, struct qstr *);
328 int (*readdir) (struct inode *, struct rpc_cred *,
329 u64, struct page *, unsigned int, int);
330 int (*mknod) (struct inode *, struct qstr *, struct iattr *,
331 dev_t, struct nfs_fh *, struct nfs_fattr *);
332 int (*statfs) (struct nfs_server *, struct nfs_fh *,
333 struct nfs_fsinfo *);
334 u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus);
338 * NFS_CALL(getattr, inode, (fattr));
340 * NFS_PROTO(inode)->getattr(fattr);
342 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
345 * Function vectors etc. for the NFS client
347 extern struct nfs_rpc_ops nfs_v2_clientops;
348 extern struct nfs_rpc_ops nfs_v3_clientops;
349 extern struct rpc_version nfs_version2;
350 extern struct rpc_version nfs_version3;
351 extern struct rpc_program nfs_program;
352 extern struct rpc_stat nfs_rpcstat;