linux_fsinfo.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. /* Constants from kernel header for various FSes.
  2. Copyright (C) 1998-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _LINUX_FSINFO_H
  16. #define _LINUX_FSINFO_H 1
  17. /* These definitions come from the kernel headers. But we cannot
  18. include the headers here because of type clashes. If new
  19. filesystem types will become available we have to add the
  20. appropriate definitions here. */
  21. /* Constant that identifies the `adfs' filesystem. */
  22. #define ADFS_SUPER_MAGIC 0xadf5
  23. /* Constant that identifies the `affs' filesystem. */
  24. #define AFFS_SUPER_MAGIC 0xadff
  25. /* Constant that identifies the `afs' filesystem. */
  26. #define AFS_SUPER_MAGIC 0x5346414F
  27. /* Constant that identifies the `anon_inodefs' filesystem. */
  28. #define ANON_INODE_FS_MAGIC 0x09041934
  29. /* Constant that identifies the `autofs' filesystem. */
  30. #define AUTOFS_SUPER_MAGIC 0x187
  31. /* Constant that identifies the `bdev' filesystem. */
  32. #define BDEVFS_MAGIC 0x62646576
  33. /* Constant that identifies the `bfs' filesystem. */
  34. #define BFS_MAGIC 0x1badface
  35. /* Constant that identifies the `binfmt_misc' filesystem. */
  36. #define BINFMTFS_MAGIC 0x42494e4d
  37. /* Constant that identifies the `btrfs' filesystem. */
  38. #define BTRFS_SUPER_MAGIC 0x9123683e
  39. /* Constant that identifies the `btrfs_test_fs' filesystem. */
  40. #define BTRFS_TEST_MAGIC 0x73727279
  41. /* Constant that identifies the `cgroup' filesystem. */
  42. #define CGROUP_SUPER_MAGIC 0x27e0eb
  43. /* Constant that identifies the `coda' filesystem. */
  44. #define CODA_SUPER_MAGIC 0x73757245
  45. /* Constant that identifies the `coherent' filesystem. */
  46. #define COH_SUPER_MAGIC 0x012ff7b7
  47. /* Constant that identifies the `cramfs' filesystem. */
  48. #define CRAMFS_MAGIC 0x28cd3d45
  49. /* Constant that identifies the `cramfs' filesystem w/opposite endianness. */
  50. #define CRAMFS_MAGIC_WEND 0x453dcd28
  51. /* Constant that identifies the `debugfs' filesystem. */
  52. #define DEBUGFS_MAGIC 0x64626720
  53. /* Constant that identifies the `devfs' filesystem. */
  54. #define DEVFS_SUPER_MAGIC 0x1373
  55. /* Constant that identifies the `devpts' filesystem. */
  56. #define DEVPTS_SUPER_MAGIC 0x1cd1
  57. /* Constants that identifies the `ecryptfs' filesystem. */
  58. #define ECRYPTFS_SUPER_MAGIC 0xf15f
  59. /* Constants that identifies the `efs' filesystem. */
  60. #define EFS_SUPER_MAGIC 0x414a53
  61. #define EFS_MAGIC 0x072959
  62. /* Constants that identifies the `evivar' filesystem. */
  63. #define EFIVARFS_MAGIC 0xde5e81e4
  64. /* Constant that identifies the `ext2' filesystem. */
  65. #define EXT2_SUPER_MAGIC 0xef53
  66. /* Constant that identifies the `ext3' filesystem. */
  67. #define EXT3_SUPER_MAGIC 0xef53
  68. /* Constant that identifies the `ext3' filesystem. */
  69. #define EXT4_SUPER_MAGIC 0xef53
  70. /* Constant that identifies the `f2fs' filesystem. */
  71. #define F2FS_SUPER_MAGIC 0xf2f52010
  72. /* Constant that identifies the `futexfs' filesystem. */
  73. #define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
  74. /* Constant that identifies the `hostfs' filesystem. */
  75. #define HOSTFS_SUPER_MAGIC 0x00c0ffee
  76. /* Constant that identifies the `hpfs' filesystem. */
  77. #define HPFS_SUPER_MAGIC 0xf995e849
  78. /* Constant that identifies the `hugetlbfs' filesystem. */
  79. #define HUGETLBFS_MAGIC 0x958458f6
  80. /* Constant that identifies the `iso9660' filesystem. */
  81. #define ISOFS_SUPER_MAGIC 0x9660
  82. /* Constant that identifies the `jffs' filesystem. */
  83. #define JFFS_SUPER_MAGIC 0x07c0
  84. /* Constant that identifies the `jffs2' filesystem. */
  85. #define JFFS2_SUPER_MAGIC 0x72b6
  86. /* Constant that identifies the `jfs' filesystem. */
  87. #define JFS_SUPER_MAGIC 0x3153464a
  88. /* Constant that identifies the `logfs' filesystem. */
  89. #define LOGFS_MAGIC_U32 0xc97e8168u
  90. /* Constant that identifies the `lustre' filesystem. */
  91. #define LUSTRE_SUPER_MAGIC 0x0BD00BD0
  92. /* Constants that identify the `minix2' filesystem. */
  93. #define MINIX2_SUPER_MAGIC 0x2468
  94. #define MINIX2_SUPER_MAGIC2 0x2478
  95. /* Constants that identify the `minix3' filesystem. */
  96. #define MINIX3_SUPER_MAGIC 0x4d5a
  97. /* Constants that identify the `minix' filesystem. */
  98. #define MINIX_SUPER_MAGIC 0x137f
  99. #define MINIX_SUPER_MAGIC2 0x138F
  100. /* Constant that identifies the `msdos' filesystem. */
  101. #define MSDOS_SUPER_MAGIC 0x4d44
  102. /* Constant that identifies the `mtd_inodefs' filesystem. */
  103. #define MTD_INODE_FS_MAGIC 0x11307854
  104. /* Constant that identifies the `ncp' filesystem. */
  105. #define NCP_SUPER_MAGIC 0x564c
  106. /* Constant that identifies the `nilfs' filesystem. */
  107. #define NILFS_SUPER_MAGIC 0x3434
  108. /* Constant that identifies the `nfs' filesystem. */
  109. #define NFS_SUPER_MAGIC 0x6969
  110. /* Constant that identifies the `ntfs' filesystem. */
  111. #define NTFS_SUPER_MAGIC 0x5346544e
  112. /* Constant that identifies the `openpromfs' filesystem. */
  113. #define OPENPROM_SUPER_MAGIC 0x9fa1
  114. /* Constant that identifies the `pipefs' filesystem. */
  115. #define PIPEFS_MAGIC 0x50495045
  116. /* Constant that identifies the `proc' filesystem. */
  117. #define PROC_SUPER_MAGIC 0x9fa0
  118. /* Constant that identifies the `pstorefs' filesystem. */
  119. #define PSTOREFS_MAGIC 0x6165676C
  120. /* Constant that identifies the `qnx4' filesystem. */
  121. #define QNX4_SUPER_MAGIC 0x002f
  122. /* Constant that identifies the `qnx6' filesystem. */
  123. #define QNX6_SUPER_MAGIC 0x68191122
  124. /* Constant that identifies the `ramfs' filesystem. */
  125. #define RAMFS_MAGIC 0x858458f6
  126. /* Constant that identifies the `reiser' filesystem. */
  127. #define REISERFS_SUPER_MAGIC 0x52654973
  128. #define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
  129. #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
  130. #define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
  131. /* Constant that identifies the `romfs' filesystem. */
  132. #define ROMFS_SUPER_MAGIC 0x7275
  133. /* Constant that identifies the `securityfs' filesystem. */
  134. #define SECURITYFS_MAGIC 0x73636673
  135. /* Constant that identifies the `selinuxfs' filesystem. */
  136. #define SELINUX_MAGIC 0xf97cff8c
  137. /* Constant that identifies the `smackfs' filesystem. */
  138. #define SMACK_MAGIC 0x43415d53 /* "SMAC" */
  139. /* Constant that identifies the `shm' filesystem. */
  140. #define SHMFS_SUPER_MAGIC 0x01021994
  141. /* Constant that identifies the `smb' filesystem. */
  142. #define SMB_SUPER_MAGIC 0x517b
  143. /* Constant that identifies the `sockfs' filesystem. */
  144. #define SOCKFS_MAGIC 0x534F434B
  145. /* Constant that identifies the `squashfs' filesystem. */
  146. #define SQUASHFS_MAGIC 0x73717368
  147. /* Constant that identifies the end of stacks allocated by the kernel. */
  148. #define STACK_END_MAGIC 0x57AC6E9D
  149. /* Constant that identifies the `sysfs' filesystem. */
  150. #define SYSFS_MAGIC 0x62656572
  151. /* Constants that identify the `sysV' filesystem. */
  152. #define SYSV2_SUPER_MAGIC 0x012ff7b6
  153. #define SYSV4_SUPER_MAGIC 0x012ff7b5
  154. /* Constant that identifies the `tmpfs' filesystem. */
  155. #define TMPFS_MAGIC 0x01021994
  156. /* Constant that identifies the `udf' filesystem. */
  157. #define UDF_SUPER_MAGIC 0x15013346
  158. /* Constant that identify the `ufs' filesystem. */
  159. #define UFS_MAGIC 0x00011954
  160. #define UFS_CIGAM 0x54190100 /* byteswapped MAGIC */
  161. /* Constant that identifies the `usbdevfs' filesystem. */
  162. #define USBDEVFS_SUPER_MAGIC 0x9fa2
  163. #define USBDEVICE_SUPER_MAGIC 0x9fa2
  164. /* Constant that identifies the `9p' filesystem. */
  165. #define V9FS_MAGIC 0x01021997
  166. /* Constant that identifies the `vxfs' filesystem. */
  167. #define VXFS_SUPER_MAGIC 0xa501fcf5
  168. /* Constant that identifies the `xenfs' filesystem. */
  169. #define XENFS_SUPER_MAGIC 0xabba1974
  170. /* Constant that identifies the `xenix' filesystem. */
  171. #define XENIX_SUPER_MAGIC 0x012ff7b4
  172. /* Constant that identifies the `xfs' filesystem. */
  173. #define XFS_SUPER_MAGIC 0x58465342
  174. /* Maximum link counts. */
  175. #define COH_LINK_MAX 10000
  176. #define EXT2_LINK_MAX 32000
  177. #define EXT4_LINK_MAX 65000
  178. #define F2FS_LINK_MAX 32000
  179. #define LUSTRE_LINK_MAX EXT4_LINK_MAX
  180. #define MINIX2_LINK_MAX 65530
  181. #define MINIX_LINK_MAX 250
  182. #define REISERFS_LINK_MAX 64535
  183. #define SYSV_LINK_MAX 126 /* 127? 251? */
  184. #define UFS_LINK_MAX EXT2_LINK_MAX
  185. #define XENIX_LINK_MAX 126 /* ?? */
  186. #define XFS_LINK_MAX 2147483647
  187. /* The Linux kernel header mentioned this as a kind of generic value. */
  188. #define LINUX_LINK_MAX 127
  189. #endif /* linux_fsinfo.h */