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