Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * NFSv3 protocol definitions |
| 3 | */ |
| 4 | #ifndef _LINUX_NFS3_H |
| 5 | #define _LINUX_NFS3_H |
| 6 | |
| 7 | #define NFS3_PORT 2049 |
| 8 | #define NFS3_MAXDATA 32768 |
| 9 | #define NFS3_MAXPATHLEN PATH_MAX |
| 10 | #define NFS3_MAXNAMLEN NAME_MAX |
| 11 | #define NFS3_MAXGROUPS 16 |
| 12 | #define NFS3_FHSIZE 64 |
| 13 | #define NFS3_COOKIESIZE 4 |
Chuck Lever | d9c407b | 2010-12-14 14:55:50 +0000 | [diff] [blame] | 14 | #define NFS3_CREATEVERFSIZE 8 |
| 15 | #define NFS3_COOKIEVERFSIZE 8 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #define NFS3_FIFO_DEV (-1) |
| 17 | #define NFS3MODE_FMT 0170000 |
| 18 | #define NFS3MODE_DIR 0040000 |
| 19 | #define NFS3MODE_CHR 0020000 |
| 20 | #define NFS3MODE_BLK 0060000 |
| 21 | #define NFS3MODE_REG 0100000 |
| 22 | #define NFS3MODE_LNK 0120000 |
| 23 | #define NFS3MODE_SOCK 0140000 |
| 24 | #define NFS3MODE_FIFO 0010000 |
| 25 | |
| 26 | /* Flags for access() call */ |
| 27 | #define NFS3_ACCESS_READ 0x0001 |
| 28 | #define NFS3_ACCESS_LOOKUP 0x0002 |
| 29 | #define NFS3_ACCESS_MODIFY 0x0004 |
| 30 | #define NFS3_ACCESS_EXTEND 0x0008 |
| 31 | #define NFS3_ACCESS_DELETE 0x0010 |
| 32 | #define NFS3_ACCESS_EXECUTE 0x0020 |
| 33 | #define NFS3_ACCESS_FULL 0x003f |
| 34 | |
| 35 | /* Flags for create mode */ |
| 36 | enum nfs3_createmode { |
| 37 | NFS3_CREATE_UNCHECKED = 0, |
| 38 | NFS3_CREATE_GUARDED = 1, |
| 39 | NFS3_CREATE_EXCLUSIVE = 2 |
| 40 | }; |
| 41 | |
| 42 | /* NFSv3 file system properties */ |
| 43 | #define NFS3_FSF_LINK 0x0001 |
| 44 | #define NFS3_FSF_SYMLINK 0x0002 |
| 45 | #define NFS3_FSF_HOMOGENEOUS 0x0008 |
| 46 | #define NFS3_FSF_CANSETTIME 0x0010 |
| 47 | /* Some shorthands. See fs/nfsd/nfs3proc.c */ |
| 48 | #define NFS3_FSF_DEFAULT 0x001B |
| 49 | #define NFS3_FSF_BILLYBOY 0x0018 |
| 50 | #define NFS3_FSF_READONLY 0x0008 |
| 51 | |
| 52 | enum nfs3_ftype { |
| 53 | NF3NON = 0, |
| 54 | NF3REG = 1, |
| 55 | NF3DIR = 2, |
| 56 | NF3BLK = 3, |
| 57 | NF3CHR = 4, |
| 58 | NF3LNK = 5, |
| 59 | NF3SOCK = 6, |
| 60 | NF3FIFO = 7, /* changed from NFSv2 (was 8) */ |
| 61 | NF3BAD = 8 |
| 62 | }; |
| 63 | |
| 64 | struct nfs3_fh { |
| 65 | unsigned short size; |
| 66 | unsigned char data[NFS3_FHSIZE]; |
| 67 | }; |
| 68 | |
| 69 | #define NFS3_VERSION 3 |
| 70 | #define NFS3PROC_NULL 0 |
| 71 | #define NFS3PROC_GETATTR 1 |
| 72 | #define NFS3PROC_SETATTR 2 |
| 73 | #define NFS3PROC_LOOKUP 3 |
| 74 | #define NFS3PROC_ACCESS 4 |
| 75 | #define NFS3PROC_READLINK 5 |
| 76 | #define NFS3PROC_READ 6 |
| 77 | #define NFS3PROC_WRITE 7 |
| 78 | #define NFS3PROC_CREATE 8 |
| 79 | #define NFS3PROC_MKDIR 9 |
| 80 | #define NFS3PROC_SYMLINK 10 |
| 81 | #define NFS3PROC_MKNOD 11 |
| 82 | #define NFS3PROC_REMOVE 12 |
| 83 | #define NFS3PROC_RMDIR 13 |
| 84 | #define NFS3PROC_RENAME 14 |
| 85 | #define NFS3PROC_LINK 15 |
| 86 | #define NFS3PROC_READDIR 16 |
| 87 | #define NFS3PROC_READDIRPLUS 17 |
| 88 | #define NFS3PROC_FSSTAT 18 |
| 89 | #define NFS3PROC_FSINFO 19 |
| 90 | #define NFS3PROC_PATHCONF 20 |
| 91 | #define NFS3PROC_COMMIT 21 |
| 92 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | #define NFS_MNT3_VERSION 3 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | |
| 95 | |
J. Bruce Fields | 065f30e | 2008-01-19 13:58:23 -0500 | [diff] [blame] | 96 | #if defined(__KERNEL__) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | |
| 98 | /* Number of 32bit words in post_op_attr */ |
| 99 | #define NFS3_POST_OP_ATTR_WORDS 22 |
| 100 | |
| 101 | #endif /* __KERNEL__ */ |
| 102 | #endif /* _LINUX_NFS3_H */ |