statfs.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _GENERIC_STATFS_H
  3. #define _GENERIC_STATFS_H
  4. #include <linux/types.h>
  5. /*
  6. * Most 64-bit platforms use 'long', while most 32-bit platforms use '__u32'.
  7. * Yes, they differ in signedness as well as size.
  8. * Special cases can override it for themselves -- except for S390x, which
  9. * is just a little too special for us. And MIPS, which I'm not touching
  10. * with a 10' pole.
  11. */
  12. #ifndef __statfs_word
  13. #if __BITS_PER_LONG == 64
  14. #define __statfs_word __kernel_long_t
  15. #else
  16. #define __statfs_word __u32
  17. #endif
  18. #endif
  19. struct statfs {
  20. __statfs_word f_type;
  21. __statfs_word f_bsize;
  22. __statfs_word f_blocks;
  23. __statfs_word f_bfree;
  24. __statfs_word f_bavail;
  25. __statfs_word f_files;
  26. __statfs_word f_ffree;
  27. __kernel_fsid_t f_fsid;
  28. __statfs_word f_namelen;
  29. __statfs_word f_frsize;
  30. __statfs_word f_flags;
  31. __statfs_word f_spare[4];
  32. };
  33. /*
  34. * ARM needs to avoid the 32-bit padding at the end, for consistency
  35. * between EABI and OABI
  36. */
  37. #ifndef ARCH_PACK_STATFS64
  38. #define ARCH_PACK_STATFS64
  39. #endif
  40. struct statfs64 {
  41. __statfs_word f_type;
  42. __statfs_word f_bsize;
  43. __u64 f_blocks;
  44. __u64 f_bfree;
  45. __u64 f_bavail;
  46. __u64 f_files;
  47. __u64 f_ffree;
  48. __kernel_fsid_t f_fsid;
  49. __statfs_word f_namelen;
  50. __statfs_word f_frsize;
  51. __statfs_word f_flags;
  52. __statfs_word f_spare[4];
  53. } ARCH_PACK_STATFS64;
  54. /*
  55. * IA64 and x86_64 need to avoid the 32-bit padding at the end,
  56. * to be compatible with the i386 ABI
  57. */
  58. #ifndef ARCH_PACK_COMPAT_STATFS64
  59. #define ARCH_PACK_COMPAT_STATFS64
  60. #endif
  61. struct compat_statfs64 {
  62. __u32 f_type;
  63. __u32 f_bsize;
  64. __u64 f_blocks;
  65. __u64 f_bfree;
  66. __u64 f_bavail;
  67. __u64 f_files;
  68. __u64 f_ffree;
  69. __kernel_fsid_t f_fsid;
  70. __u32 f_namelen;
  71. __u32 f_frsize;
  72. __u32 f_flags;
  73. __u32 f_spare[4];
  74. } ARCH_PACK_COMPAT_STATFS64;
  75. #endif /* _GENERIC_STATFS_H */