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