Deleted Added
full compact
nfsproto.h (83651) nfsproto.h (122698)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfsproto.h 8.2 (Berkeley) 3/30/95
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfsproto.h 8.2 (Berkeley) 3/30/95
37 * $FreeBSD: head/sys/nfs/nfsproto.h 83651 2001-09-18 23:32:09Z peter $
37 * $FreeBSD: head/sys/nfs/nfsproto.h 122698 2003-11-14 20:54:10Z alfred $
38 */
39
40#ifndef _NFS_NFSPROTO_H_
41#define _NFS_NFSPROTO_H_
42
43/*
44 * nfs definitions as per the Version 2 and 3 specs
45 */

--- 4 unchanged lines hidden (view full) ---

50 * and in the "NFS: Network File System Version 3 Protocol
51 * Specification"
52 */
53
54#define NFS_PORT 2049
55#define NFS_PROG 100003
56#define NFS_VER2 2
57#define NFS_VER3 3
38 */
39
40#ifndef _NFS_NFSPROTO_H_
41#define _NFS_NFSPROTO_H_
42
43/*
44 * nfs definitions as per the Version 2 and 3 specs
45 */

--- 4 unchanged lines hidden (view full) ---

50 * and in the "NFS: Network File System Version 3 Protocol
51 * Specification"
52 */
53
54#define NFS_PORT 2049
55#define NFS_PROG 100003
56#define NFS_VER2 2
57#define NFS_VER3 3
58#define NFS_VER4 4
59
58#define NFS_V2MAXDATA 8192
59#define NFS_MAXDGRAMDATA 16384
60#define NFS_MAXDATA 32768
61#define NFS_MAXPATHLEN 1024
62#define NFS_MAXNAMLEN 255
60#define NFS_V2MAXDATA 8192
61#define NFS_MAXDGRAMDATA 16384
62#define NFS_MAXDATA 32768
63#define NFS_MAXPATHLEN 1024
64#define NFS_MAXNAMLEN 255
63#define NFS_MAXPKTHDR 404
65#define NFS_MAXPKTHDR 404 /* XXXv4 this needs to be adjust for v4 */
64#define NFS_MAXPACKET (NFS_MAXPKTHDR + NFS_MAXDATA)
65#define NFS_MINPACKET 20
66#define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */
67
66#define NFS_MAXPACKET (NFS_MAXPKTHDR + NFS_MAXDATA)
67#define NFS_MINPACKET 20
68#define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */
69
68/* Stat numbers for rpc returns (version 2 and 3) */
70/* Stat numbers for rpc returns (version 2, 3 and 4) */
69#define NFS_OK 0
70#define NFSERR_PERM 1
71#define NFSERR_NOENT 2
72#define NFSERR_IO 5
73#define NFSERR_NXIO 6
74#define NFSERR_ACCES 13
75#define NFSERR_EXIST 17
76#define NFSERR_XDEV 18 /* Version 3 only */

--- 6 unchanged lines hidden (view full) ---

83#define NFSERR_ROFS 30
84#define NFSERR_MLINK 31 /* Version 3 only */
85#define NFSERR_NAMETOL 63
86#define NFSERR_NOTEMPTY 66
87#define NFSERR_DQUOT 69
88#define NFSERR_STALE 70
89#define NFSERR_REMOTE 71 /* Version 3 only */
90#define NFSERR_WFLUSH 99 /* Version 2 only */
71#define NFS_OK 0
72#define NFSERR_PERM 1
73#define NFSERR_NOENT 2
74#define NFSERR_IO 5
75#define NFSERR_NXIO 6
76#define NFSERR_ACCES 13
77#define NFSERR_EXIST 17
78#define NFSERR_XDEV 18 /* Version 3 only */

--- 6 unchanged lines hidden (view full) ---

85#define NFSERR_ROFS 30
86#define NFSERR_MLINK 31 /* Version 3 only */
87#define NFSERR_NAMETOL 63
88#define NFSERR_NOTEMPTY 66
89#define NFSERR_DQUOT 69
90#define NFSERR_STALE 70
91#define NFSERR_REMOTE 71 /* Version 3 only */
92#define NFSERR_WFLUSH 99 /* Version 2 only */
91#define NFSERR_BADHANDLE 10001 /* The rest Version 3 only */
93#define NFSERR_BADHANDLE 10001 /* The rest Version 3, 4 only */
92#define NFSERR_NOT_SYNC 10002
93#define NFSERR_BAD_COOKIE 10003
94#define NFSERR_NOTSUPP 10004
95#define NFSERR_TOOSMALL 10005
96#define NFSERR_SERVERFAULT 10006
97#define NFSERR_BADTYPE 10007
98#define NFSERR_JUKEBOX 10008
99#define NFSERR_TRYLATER NFSERR_JUKEBOX
94#define NFSERR_NOT_SYNC 10002
95#define NFSERR_BAD_COOKIE 10003
96#define NFSERR_NOTSUPP 10004
97#define NFSERR_TOOSMALL 10005
98#define NFSERR_SERVERFAULT 10006
99#define NFSERR_BADTYPE 10007
100#define NFSERR_JUKEBOX 10008
101#define NFSERR_TRYLATER NFSERR_JUKEBOX
102#define NFSERR_SAME 10009 /* The rest Version 4 only */
103#define NFSERR_DENIED 10010
104#define NFSERR_EXPIRED 10011
105#define NFSERR_LOCKED 10012
106#define NFSERR_GRACE 10013
107#define NFSERR_FHEXPIRED 10014
108#define NFSERR_SHARDE_DENIED 10015
109#define NFSERR_WRONGSEC 10016
110#define NFSERR_CLID_INUSE 10017
111#define NFSERR_RESOURCE 10018
112#define NFSERR_MOVED 10019
113#define NFSERR_NOFILEHANDLE 10020
114#define NFSERR_MINOR_VERS_MISMATCH 10021
115#define NFSERR_STALE_CLIENTID 10022
116#define NFSERR_STALE_STATEID 10023
117#define NFSERR_OLD_STATEID 10024
118#define NFSERR_BAD_STATEID 10025
119#define NFSERR_BAD_SEQID 10026
120#define NFSERR_NOT_SAME 10027
121#define NFSERR_LOCK_RANGE 10028
122#define NFSERR_SYMLINK 10029
123#define NFSERR_READDIR_NOSPC 10030
124#define NFSERR_LEASE_MOVED 10031
125#define NFSERR_ATTRNOTSUPP 10032
126#define NFSERR_NO_GRACE 10033
127#define NFSERR_RECLAIM_BAD 10034
128#define NFSERR_RECLAIM_CONFLICT 10035
129#define NFSERR_BADXDR 10036
130#define NFSERR_LOCKS_HELD 10037
131#define NFSERR_OPENMODE 10038
132#define NFSERR_BADOWNER 10039
133#define NFSERR_BADCHAR 10040
134#define NFSERR_BADNAME 10041
135#define NFSERR_BAD_RANGE 10042
136#define NFSERR_LOCK_NOTSUPP 10043
137#define NFSERR_OP_ILLEGAL 10044
138#define NFSERR_DEADLOCK 10045
139#define NFSERR_FILE_OPEN 10046
100#define NFSERR_STALEWRITEVERF 30001 /* Fake return for nfs_commit() */
101
140#define NFSERR_STALEWRITEVERF 30001 /* Fake return for nfs_commit() */
141
142
143
102#define NFSERR_RETVOID 0x20000000 /* Return void, not error */
103#define NFSERR_AUTHERR 0x40000000 /* Mark an authentication error */
104#define NFSERR_RETERR 0x80000000 /* Mark an error return for V3 */
105
106/* Sizes in bytes of various nfs rpc components */
107#define NFSX_UNSIGNED 4
108
109/* specific to NFS Version 2 */

--- 13 unchanged lines hidden (view full) ---

123#define NFSX_V3WCCDATA (NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED)
124#define NFSX_V3COOKIEVERF 8
125#define NFSX_V3WRITEVERF 8
126#define NFSX_V3CREATEVERF 8
127#define NFSX_V3STATFS 52
128#define NFSX_V3FSINFO 48
129#define NFSX_V3PATHCONF 24
130
144#define NFSERR_RETVOID 0x20000000 /* Return void, not error */
145#define NFSERR_AUTHERR 0x40000000 /* Mark an authentication error */
146#define NFSERR_RETERR 0x80000000 /* Mark an error return for V3 */
147
148/* Sizes in bytes of various nfs rpc components */
149#define NFSX_UNSIGNED 4
150
151/* specific to NFS Version 2 */

--- 13 unchanged lines hidden (view full) ---

165#define NFSX_V3WCCDATA (NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED)
166#define NFSX_V3COOKIEVERF 8
167#define NFSX_V3WRITEVERF 8
168#define NFSX_V3CREATEVERF 8
169#define NFSX_V3STATFS 52
170#define NFSX_V3FSINFO 48
171#define NFSX_V3PATHCONF 24
172
173/* specific to NFS Version 4 */
174#define NFSX_V4VERF 8
175#define NFSX_V4FH 128
176#define NFSX_V4STATEID 16
177
131/* variants for both versions */
132#define NFSX_FH(v3) ((v3) ? (NFSX_V3FHMAX + NFSX_UNSIGNED) : \
133 NFSX_V2FH)
134#define NFSX_SRVFH(v3) ((v3) ? NFSX_V3FH : NFSX_V2FH)
135#define NFSX_FATTR(v3) ((v3) ? NFSX_V3FATTR : NFSX_V2FATTR)
136#define NFSX_PREOPATTR(v3) ((v3) ? (7 * NFSX_UNSIGNED) : 0)
137#define NFSX_POSTOPATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : 0)
138#define NFSX_POSTOPORFATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : \

--- 49 unchanged lines hidden (view full) ---

188#define NFSV2PROC_RENAME 11
189#define NFSV2PROC_LINK 12
190#define NFSV2PROC_SYMLINK 13
191#define NFSV2PROC_MKDIR 14
192#define NFSV2PROC_RMDIR 15
193#define NFSV2PROC_READDIR 16
194#define NFSV2PROC_STATFS 17
195
178/* variants for both versions */
179#define NFSX_FH(v3) ((v3) ? (NFSX_V3FHMAX + NFSX_UNSIGNED) : \
180 NFSX_V2FH)
181#define NFSX_SRVFH(v3) ((v3) ? NFSX_V3FH : NFSX_V2FH)
182#define NFSX_FATTR(v3) ((v3) ? NFSX_V3FATTR : NFSX_V2FATTR)
183#define NFSX_PREOPATTR(v3) ((v3) ? (7 * NFSX_UNSIGNED) : 0)
184#define NFSX_POSTOPATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : 0)
185#define NFSX_POSTOPORFATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : \

--- 49 unchanged lines hidden (view full) ---

235#define NFSV2PROC_RENAME 11
236#define NFSV2PROC_LINK 12
237#define NFSV2PROC_SYMLINK 13
238#define NFSV2PROC_MKDIR 14
239#define NFSV2PROC_RMDIR 15
240#define NFSV2PROC_READDIR 16
241#define NFSV2PROC_STATFS 17
242
243/* Version 4 procedure numbers */
244#define NFSV4PROC_NULL 0
245#define NFSV4PROC_COMPOUND 1
246
247/* Version 4 operation numbers */
248#define NFSV4OP_ACCESS 3
249#define NFSV4OP_CLOSE 4
250#define NFSV4OP_COMMIT 5
251#define NFSV4OP_CREATE 6
252#define NFSV4OP_DELEGPURGE 7
253#define NFSV4OP_DELEGRETURN 8
254#define NFSV4OP_GETATTR 9
255#define NFSV4OP_GETFH 10
256#define NFSV4OP_LINK 11
257#define NFSV4OP_LOCK 12
258#define NFSV4OP_LOCKT 13
259#define NFSV4OP_LOCKU 14
260#define NFSV4OP_LOOKUP 15
261#define NFSV4OP_LOOKUPP 16
262#define NFSV4OP_NVERIFY 17
263#define NFSV4OP_OPEN 18
264#define NFSV4OP_OPENATTR 19
265#define NFSV4OP_OPEN_CONFIRM 20
266#define NFSV4OP_OPEN_DOWNGRADE 21
267#define NFSV4OP_PUTFH 22
268#define NFSV4OP_PUTPUBFH 23
269#define NFSV4OP_PUTROOTFH 24
270#define NFSV4OP_READ 25
271#define NFSV4OP_READDIR 26
272#define NFSV4OP_READLINK 27
273#define NFSV4OP_REMOVE 28
274#define NFSV4OP_RENAME 29
275#define NFSV4OP_RENEW 30
276#define NFSV4OP_RESTOREFH 31
277#define NFSV4OP_SAVEFH 32
278#define NFSV4OP_SECINFO 33
279#define NFSV4OP_SETATTR 34
280#define NFSV4OP_SETCLIENTID 35
281#define NFSV4OP_SETCLIENTID_CONFIRM 36
282#define NFSV4OP_VERIFY 37
283#define NFSV4OP_WRITE 38
284
196/*
197 * Constants used by the Version 3 protocol for various RPCs
198 */
199#define NFSV3SATTRTIME_DONTCHANGE 0
200#define NFSV3SATTRTIME_TOSERVER 1
201#define NFSV3SATTRTIME_TOCLIENT 2
202
203#define NFSV3ACCESS_READ 0x01

--- 11 unchanged lines hidden (view full) ---

215#define NFSV3CREATE_GUARDED 1
216#define NFSV3CREATE_EXCLUSIVE 2
217
218#define NFSV3FSINFO_LINK 0x01
219#define NFSV3FSINFO_SYMLINK 0x02
220#define NFSV3FSINFO_HOMOGENEOUS 0x08
221#define NFSV3FSINFO_CANSETTIME 0x10
222
285/*
286 * Constants used by the Version 3 protocol for various RPCs
287 */
288#define NFSV3SATTRTIME_DONTCHANGE 0
289#define NFSV3SATTRTIME_TOSERVER 1
290#define NFSV3SATTRTIME_TOCLIENT 2
291
292#define NFSV3ACCESS_READ 0x01

--- 11 unchanged lines hidden (view full) ---

304#define NFSV3CREATE_GUARDED 1
305#define NFSV3CREATE_EXCLUSIVE 2
306
307#define NFSV3FSINFO_LINK 0x01
308#define NFSV3FSINFO_SYMLINK 0x02
309#define NFSV3FSINFO_HOMOGENEOUS 0x08
310#define NFSV3FSINFO_CANSETTIME 0x10
311
312/*
313 * Constants used by the Version 4 protocol for various RPCs
314 */
315
316#define NFSV4ACCESS_READ 0x01
317#define NFSV4ACCESS_LOOKUP 0x02
318#define NFSV4ACCESS_MODIFY 0x04
319#define NFSV4ACCESS_EXTEND 0x08
320#define NFSV4ACCESS_DELETE 0x10
321#define NFSV4ACCESS_EXECUTE 0x20
322
323#define NFSV4OPENRES_MLOCK 0x01
324#define NFSV4OPENRES_CONFIRM 0x02
325
326#define NFSV4OPENSHARE_ACCESS_READ 0x01
327#define NFSV4OPENSHARE_ACCESS_WRITE 0x02
328#define NFSV4OPENSHARE_ACCESS_BOTH 0x03
329#define NFSV4OPENSHARE_DENY_NONE 0x00
330#define NFSV4OPENSHARE_DENY_READ 0x01
331#define NFSV4OPENSHARE_DENY_WRITE 0x02
332#define NFSV4OPENSHARE_DENY_BOTH 0x03
333
223/* File types */
334/* File types */
224typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5,
225 NFSOCK=6, NFFIFO=7 } nfstype;
335typedef enum {
336 NFNON=0,
337 NFREG=1,
338 NFDIR=2,
339 NFBLK=3,
340 NFCHR=4,
341 NFLNK=5,
342 NFSOCK=6,
343 NFFIFO=7,
344 NFATTRDIR = 8,
345 NFNAMEDATTR = 9,
346 NFBAD = 10,
347} nfstype;
226
348
349/* NFSv4 claim type */
350typedef enum {
351 NCLNULL = 0,
352 NCLPREV = 1,
353 NCLDELEGCUR = 2,
354 NCLDELEGPREV = 3,
355} nfsv4cltype;
356
357/* Other NFSv4 types */
358typedef enum {
359 NSHUNSTABLE = 0,
360 NSHDATASYNC = 1,
361 NSHFILESYNC = 2,
362} nfsv4stablehow;
363
364typedef enum { OTNOCREATE = 0, OTCREATE = 1 } nfsv4opentype;
365typedef enum { CMUNCHECKED = 0, CMGUARDED = 1, CMEXCLUSIVE = 2 } nfsv4createmode;
366typedef enum { THSERVERTIME = 0, THCLIENTTIME = 1 } nfsv4timehow;
367typedef enum { ODNONE = 0, ODREAD = 1, ODWRITE = 2 } nfsv4opendelegtype;
368
227/* Structs for common parts of the rpc's */
369/* Structs for common parts of the rpc's */
370
228/*
229 * File Handle (32 bytes for version 2), variable up to 64 for version 3.
230 * File Handles of up to NFS_SMALLFH in size are stored directly in the
231 * nfs node, whereas larger ones are malloc'd. (This never happens when
232 * NFS_SMALLFH is set to 64.)
233 * NFS_SMALLFH should be in the range of 32 to 64 and be divisible by 4.
234 */
235#ifndef NFS_SMALLFH
371/*
372 * File Handle (32 bytes for version 2), variable up to 64 for version 3.
373 * File Handles of up to NFS_SMALLFH in size are stored directly in the
374 * nfs node, whereas larger ones are malloc'd. (This never happens when
375 * NFS_SMALLFH is set to 64.)
376 * NFS_SMALLFH should be in the range of 32 to 64 and be divisible by 4.
377 */
378#ifndef NFS_SMALLFH
236#define NFS_SMALLFH 64
379#define NFS_SMALLFH 128
237#endif
238union nfsfh {
239 fhandle_t fh_generic;
240 u_char fh_bytes[NFS_SMALLFH];
241};
242typedef union nfsfh nfsfh_t;
243
244struct nfsv2_time {

--- 31 unchanged lines hidden (view full) ---

276 */
277struct nfsv3_spec {
278 u_int32_t specdata1;
279 u_int32_t specdata2;
280};
281typedef struct nfsv3_spec nfsv3spec;
282
283/*
380#endif
381union nfsfh {
382 fhandle_t fh_generic;
383 u_char fh_bytes[NFS_SMALLFH];
384};
385typedef union nfsfh nfsfh_t;
386
387struct nfsv2_time {

--- 31 unchanged lines hidden (view full) ---

419 */
420struct nfsv3_spec {
421 u_int32_t specdata1;
422 u_int32_t specdata2;
423};
424typedef struct nfsv3_spec nfsv3spec;
425
426/*
427 * NFS Version 4 bitmap.
428 */
429struct nfsv4_bitmap {
430 uint32_t bmlen;
431 uint32_t *bmval;
432};
433typedef struct nfsv4_bitmap nfsv4bitmap;
434
435struct nfsv4_changeinfo {
436 u_int ciatomic;
437 uint64_t cibefore;
438 uint64_t ciafter;
439};
440typedef struct nfsv4_changeinfo nfsv4changeinfo;
441
442/*
284 * File attributes and setable attributes. These structures cover both
285 * NFS version 2 and the version 3 protocol. Note that the union is only
286 * used so that one pointer can refer to both variants. These structures
287 * go out on the wire and must be densely packed, so no quad data types
288 * are used. (all fields are longs or u_longs or structures of same)
289 * NB: You can't do sizeof(struct nfs_fattr), you must use the
290 * NFSX_FATTR(v3) macro.
291 */

--- 42 unchanged lines hidden (view full) ---

334#define fa3_used fa_un.fa_nfsv3.nfsv3fa_used
335#define fa3_rdev fa_un.fa_nfsv3.nfsv3fa_rdev
336#define fa3_fsid fa_un.fa_nfsv3.nfsv3fa_fsid
337#define fa3_fileid fa_un.fa_nfsv3.nfsv3fa_fileid
338#define fa3_atime fa_un.fa_nfsv3.nfsv3fa_atime
339#define fa3_mtime fa_un.fa_nfsv3.nfsv3fa_mtime
340#define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime
341
443 * File attributes and setable attributes. These structures cover both
444 * NFS version 2 and the version 3 protocol. Note that the union is only
445 * used so that one pointer can refer to both variants. These structures
446 * go out on the wire and must be densely packed, so no quad data types
447 * are used. (all fields are longs or u_longs or structures of same)
448 * NB: You can't do sizeof(struct nfs_fattr), you must use the
449 * NFSX_FATTR(v3) macro.
450 */

--- 42 unchanged lines hidden (view full) ---

493#define fa3_used fa_un.fa_nfsv3.nfsv3fa_used
494#define fa3_rdev fa_un.fa_nfsv3.nfsv3fa_rdev
495#define fa3_fsid fa_un.fa_nfsv3.nfsv3fa_fsid
496#define fa3_fileid fa_un.fa_nfsv3.nfsv3fa_fileid
497#define fa3_atime fa_un.fa_nfsv3.nfsv3fa_atime
498#define fa3_mtime fa_un.fa_nfsv3.nfsv3fa_mtime
499#define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime
500
501struct nfsv4_fattr {
502 u_int fa4_valid;
503 nfstype fa4_type;
504 off_t fa4_size;
505 uint64_t fa4_fsid_major;
506 uint64_t fa4_fsid_minor;
507 uint64_t fa4_fileid;
508 mode_t fa4_mode;
509 nlink_t fa4_nlink;
510 uid_t fa4_uid;
511 gid_t fa4_gid;
512 uint32_t fa4_rdev_major;
513 uint32_t fa4_rdev_minor;
514 struct timespec fa4_atime;
515 struct timespec fa4_ctime;
516 struct timespec fa4_mtime;
517 uint64_t fa4_maxread;
518 uint64_t fa4_maxwrite;
519 uint64_t fa4_ffree;
520 uint64_t fa4_ftotal;
521 uint32_t fa4_maxname;
522 uint64_t fa4_savail;
523 uint64_t fa4_sfree;
524 uint64_t fa4_stotal;
525 uint64_t fa4_changeid;
526 uint32_t fa4_lease_time;
527 uint64_t fa4_maxfilesize;
528};
529
530/* Flags for fa4_valid */
531#define FA4V_SIZE 0x00000001
532#define FA4V_FSID 0x00000002
533#define FA4V_FILEID 0x00000004
534#define FA4V_MODE 0x00000008
535#define FA4V_NLINK 0x00000010
536#define FA4V_UID 0x00000020
537#define FA4V_GID 0x00000040
538#define FA4V_RDEV 0x00000080
539#define FA4V_ATIME 0x00000100
540#define FA4V_CTIME 0x00000200
541#define FA4V_MTIME 0x00000400
542#define FA4V_MAXREAD 0x00000800
543#define FA4V_MAXWRITE 0x00001000
544#define FA4V_TYPE 0x00002000
545#define FA4V_FFREE 0x00004000
546#define FA4V_FTOTAL 0x00008000
547#define FA4V_MAXNAME 0x00010000
548#define FA4V_SAVAIL 0x00020000
549#define FA4V_SFREE 0x00040000
550#define FA4V_STOTAL 0x00080000
551#define FA4V_CHANGEID 0x00100000
552#define FA4V_LEASE_TIME 0x00200000
553#define FA4V_MAXFILESIZE 0x00400000
554#define FA4V_ACL 0x00800000
555
556/* Offsets into bitmask */
557#define FA4_SUPPORTED_ATTRS 0
558#define FA4_TYPE 1
559#define FA4_FH_EXPIRE_TYPE 2
560#define FA4_CHANGE 3
561#define FA4_SIZE 4
562#define FA4_LINK_SUPPORT 5
563#define FA4_SYMLINK_SUPPORT 6
564#define FA4_NAMED_ATTR 7
565#define FA4_FSID 8
566#define FA4_UNIQUE_HANDLES 9
567#define FA4_LEASE_TIME 10
568#define FA4_RDATTR_ERROR 11
569#define FA4_ACL 12
570#define FA4_ACLSUPPORT 13
571#define FA4_ARCHIVE 14
572#define FA4_CANSETTIME 15
573#define FA4_CASE_INSENSITIVE 16
574#define FA4_CASE_PRESERVING 17
575#define FA4_CHOWN_RESTRICTED 18
576#define FA4_FILEHANDLE 19
577#define FA4_FILEID 20
578#define FA4_FILES_AVAIL 21
579#define FA4_FILES_FREE 22
580#define FA4_FILES_TOTAL 23
581#define FA4_FS_LOCATIONS 24
582#define FA4_HIDDEN 25
583#define FA4_HOMOGENEOUS 26
584#define FA4_MAXFILESIZE 27
585#define FA4_MAXLINK 28
586#define FA4_MAXNAME 29
587#define FA4_MAXREAD 30
588#define FA4_MAXWRITE 31
589#define FA4_MIMETYPE 32
590#define FA4_MODE 33
591#define FA4_NO_TRUNC 34
592#define FA4_NUMLINKS 35
593#define FA4_OWNER 36
594#define FA4_OWNER_GROUP 37
595#define FA4_QUOTA_HARD 38
596#define FA4_QUOTA_SOFT 39
597#define FA4_QUOTA_USED 40
598#define FA4_RAWDEV 41
599#define FA4_SPACE_AVAIL 42
600#define FA4_SPACE_FREE 43
601#define FA4_SPACE_TOTAL 44
602#define FA4_SPACE_USED 45
603#define FA4_SYSTEM 46
604#define FA4_TIME_ACCESS 47
605#define FA4_TIME_ACCESS_SET 48
606#define FA4_TIME_BACKUP 49
607#define FA4_TIME_CREATE 50
608#define FA4_TIME_DELTA 51
609#define FA4_TIME_METADATA 52
610#define FA4_TIME_MODIFY 53
611#define FA4_TIME_MODIFY_SET 54
612#define FA4_ATTR_MAX 55
613
614/* Macros for v4 fattr manipulation */
615#define FA4_SET(n, p) ((p)[(n)/32] |= (1 << ((n) % 32)))
616#define FA4_CLR(n, p) ((p)[(n)/32] &= ~(1 << ((n) % 32)))
617#define FA4_ISSET(n, p) ((p)[(n)/32] & (1 << ((n) % 32)))
618#define FA4_ZERO(p) bzero((p), 8)
619#define FA4_SKIP(p) ((p) += 2)
620
342struct nfsv2_sattr {
343 u_int32_t sa_mode;
344 u_int32_t sa_uid;
345 u_int32_t sa_gid;
346 u_int32_t sa_size;
347 nfstime2 sa_atime;
348 nfstime2 sa_mtime;
349};

--- 73 unchanged lines hidden ---
621struct nfsv2_sattr {
622 u_int32_t sa_mode;
623 u_int32_t sa_uid;
624 u_int32_t sa_gid;
625 u_int32_t sa_size;
626 nfstime2 sa_atime;
627 nfstime2 sa_mtime;
628};

--- 73 unchanged lines hidden ---