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 8
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 8
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
113 struct nfs_fattr fattr;
117 * The following types are for NFSv2 only.
119 struct nfs_sattrargs {
121 struct iattr * sattr;
124 struct nfs_diropargs {
130 struct nfs_createargs {
134 struct iattr * sattr;
137 struct nfs_renameargs {
138 struct nfs_fh * fromfh;
139 const char * fromname;
140 unsigned int fromlen;
141 struct nfs_fh * tofh;
146 struct nfs_linkargs {
147 struct nfs_fh * fromfh;
148 struct nfs_fh * tofh;
153 struct nfs_symlinkargs {
154 struct nfs_fh * fromfh;
155 const char * fromname;
156 unsigned int fromlen;
159 struct iattr * sattr;
162 struct nfs_readdirargs {
166 struct page ** pages;
171 struct nfs_fattr * fattr;
174 struct nfs_readlinkargs {
177 struct page ** pages;
180 struct nfs3_sattrargs {
182 struct iattr * sattr;
187 struct nfs3_diropargs {
193 struct nfs3_accessargs {
198 struct nfs3_createargs {
202 struct iattr * sattr;
203 enum nfs3_createmode createmode;
207 struct nfs3_mkdirargs {
211 struct iattr * sattr;
214 struct nfs3_symlinkargs {
215 struct nfs_fh * fromfh;
216 const char * fromname;
217 unsigned int fromlen;
220 struct iattr * sattr;
223 struct nfs3_mknodargs {
227 enum nfs3_ftype type;
228 struct iattr * sattr;
232 struct nfs3_renameargs {
233 struct nfs_fh * fromfh;
234 const char * fromname;
235 unsigned int fromlen;
236 struct nfs_fh * tofh;
241 struct nfs3_linkargs {
242 struct nfs_fh * fromfh;
243 struct nfs_fh * tofh;
248 struct nfs3_readdirargs {
254 struct page ** pages;
257 struct nfs3_diropres {
258 struct nfs_fattr * dir_attr;
260 struct nfs_fattr * fattr;
263 struct nfs3_accessres {
264 struct nfs_fattr * fattr;
268 struct nfs3_readlinkargs {
271 struct page ** pages;
274 struct nfs3_renameres {
275 struct nfs_fattr * fromattr;
276 struct nfs_fattr * toattr;
279 struct nfs3_linkres {
280 struct nfs_fattr * dir_attr;
281 struct nfs_fattr * fattr;
284 struct nfs3_readdirres {
285 struct nfs_fattr * dir_attr;
291 * RPC procedure vector for NFSv2/NFSv3 demuxing
294 int version; /* Protocol version */
296 int (*getroot) (struct nfs_server *, struct nfs_fh *,
298 int (*getattr) (struct inode *, struct nfs_fattr *);
299 int (*setattr) (struct inode *, struct nfs_fattr *,
301 int (*lookup) (struct inode *, struct qstr *,
302 struct nfs_fh *, struct nfs_fattr *);
303 int (*access) (struct inode *, int , int);
304 int (*readlink)(struct inode *, struct page *);
305 int (*read) (struct inode *, struct rpc_cred *,
307 int, unsigned int, unsigned int,
308 struct page *, int *eofp);
309 int (*write) (struct inode *, struct rpc_cred *,
311 int, unsigned int, unsigned int,
312 struct page *, struct nfs_writeverf *verfp);
313 int (*commit) (struct inode *, struct nfs_fattr *,
314 unsigned long, unsigned int);
315 int (*create) (struct inode *, struct qstr *, struct iattr *,
316 int, struct nfs_fh *, struct nfs_fattr *);
317 int (*remove) (struct inode *, struct qstr *);
318 int (*unlink_setup) (struct rpc_message *,
319 struct dentry *, struct qstr *);
320 void (*unlink_done) (struct dentry *, struct rpc_message *);
321 int (*rename) (struct inode *, struct qstr *,
322 struct inode *, struct qstr *);
323 int (*link) (struct inode *, struct inode *, struct qstr *);
324 int (*symlink) (struct inode *, struct qstr *, struct qstr *,
325 struct iattr *, struct nfs_fh *,
327 int (*mkdir) (struct inode *, struct qstr *, struct iattr *,
328 struct nfs_fh *, struct nfs_fattr *);
329 int (*rmdir) (struct inode *, struct qstr *);
330 int (*readdir) (struct inode *, struct rpc_cred *,
331 u64, struct page *, unsigned int, int);
332 int (*mknod) (struct inode *, struct qstr *, struct iattr *,
333 dev_t, struct nfs_fh *, struct nfs_fattr *);
334 int (*statfs) (struct nfs_server *, struct nfs_fh *,
335 struct nfs_fsinfo *);
336 u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus);
340 * NFS_CALL(getattr, inode, (fattr));
342 * NFS_PROTO(inode)->getattr(fattr);
344 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
347 * Function vectors etc. for the NFS client
349 extern struct nfs_rpc_ops nfs_v2_clientops;
350 extern struct nfs_rpc_ops nfs_v3_clientops;
351 extern struct rpc_version nfs_version2;
352 extern struct rpc_version nfs_version3;
353 extern struct rpc_program nfs_program;
354 extern struct rpc_stat nfs_rpcstat;