nfs3.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * NFSv3 protocol definitions
  4. */
  5. #ifndef _UAPI_LINUX_NFS3_H
  6. #define _UAPI_LINUX_NFS3_H
  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
  14. #define NFS3_CREATEVERFSIZE 8
  15. #define NFS3_COOKIEVERFSIZE 8
  16. #define NFS3_WRITEVERFSIZE 8
  17. #define NFS3_FIFO_DEV (-1)
  18. #define NFS3MODE_FMT 0170000
  19. #define NFS3MODE_DIR 0040000
  20. #define NFS3MODE_CHR 0020000
  21. #define NFS3MODE_BLK 0060000
  22. #define NFS3MODE_REG 0100000
  23. #define NFS3MODE_LNK 0120000
  24. #define NFS3MODE_SOCK 0140000
  25. #define NFS3MODE_FIFO 0010000
  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. /* Flags for create mode */
  35. enum nfs3_createmode {
  36. NFS3_CREATE_UNCHECKED = 0,
  37. NFS3_CREATE_GUARDED = 1,
  38. NFS3_CREATE_EXCLUSIVE = 2
  39. };
  40. /* NFSv3 file system properties */
  41. #define NFS3_FSF_LINK 0x0001
  42. #define NFS3_FSF_SYMLINK 0x0002
  43. #define NFS3_FSF_HOMOGENEOUS 0x0008
  44. #define NFS3_FSF_CANSETTIME 0x0010
  45. /* Some shorthands. See fs/nfsd/nfs3proc.c */
  46. #define NFS3_FSF_DEFAULT 0x001B
  47. #define NFS3_FSF_BILLYBOY 0x0018
  48. #define NFS3_FSF_READONLY 0x0008
  49. enum nfs3_ftype {
  50. NF3NON = 0,
  51. NF3REG = 1,
  52. NF3DIR = 2,
  53. NF3BLK = 3,
  54. NF3CHR = 4,
  55. NF3LNK = 5,
  56. NF3SOCK = 6,
  57. NF3FIFO = 7, /* changed from NFSv2 (was 8) */
  58. NF3BAD = 8
  59. };
  60. struct nfs3_fh {
  61. unsigned short size;
  62. unsigned char data[NFS3_FHSIZE];
  63. };
  64. #define NFS3_VERSION 3
  65. #define NFS3PROC_NULL 0
  66. #define NFS3PROC_GETATTR 1
  67. #define NFS3PROC_SETATTR 2
  68. #define NFS3PROC_LOOKUP 3
  69. #define NFS3PROC_ACCESS 4
  70. #define NFS3PROC_READLINK 5
  71. #define NFS3PROC_READ 6
  72. #define NFS3PROC_WRITE 7
  73. #define NFS3PROC_CREATE 8
  74. #define NFS3PROC_MKDIR 9
  75. #define NFS3PROC_SYMLINK 10
  76. #define NFS3PROC_MKNOD 11
  77. #define NFS3PROC_REMOVE 12
  78. #define NFS3PROC_RMDIR 13
  79. #define NFS3PROC_RENAME 14
  80. #define NFS3PROC_LINK 15
  81. #define NFS3PROC_READDIR 16
  82. #define NFS3PROC_READDIRPLUS 17
  83. #define NFS3PROC_FSSTAT 18
  84. #define NFS3PROC_FSINFO 19
  85. #define NFS3PROC_PATHCONF 20
  86. #define NFS3PROC_COMMIT 21
  87. #define NFS_MNT3_VERSION 3
  88. #endif /* _UAPI_LINUX_NFS3_H */