18a1ab315SDavid Howells #ifndef _UAPI_GENERIC_STATFS_H
28a1ab315SDavid Howells #define _UAPI_GENERIC_STATFS_H
38a1ab315SDavid Howells 
48a1ab315SDavid Howells #include <linux/types.h>
58a1ab315SDavid Howells 
68a1ab315SDavid Howells 
78a1ab315SDavid Howells /*
88a1ab315SDavid Howells  * Most 64-bit platforms use 'long', while most 32-bit platforms use '__u32'.
98a1ab315SDavid Howells  * Yes, they differ in signedness as well as size.
108a1ab315SDavid Howells  * Special cases can override it for themselves -- except for S390x, which
118a1ab315SDavid Howells  * is just a little too special for us. And MIPS, which I'm not touching
128a1ab315SDavid Howells  * with a 10' pole.
138a1ab315SDavid Howells  */
148a1ab315SDavid Howells #ifndef __statfs_word
158a1ab315SDavid Howells #if __BITS_PER_LONG == 64
168a1ab315SDavid Howells #define __statfs_word long
178a1ab315SDavid Howells #else
188a1ab315SDavid Howells #define __statfs_word __u32
198a1ab315SDavid Howells #endif
208a1ab315SDavid Howells #endif
218a1ab315SDavid Howells 
228a1ab315SDavid Howells struct statfs {
238a1ab315SDavid Howells 	__statfs_word f_type;
248a1ab315SDavid Howells 	__statfs_word f_bsize;
258a1ab315SDavid Howells 	__statfs_word f_blocks;
268a1ab315SDavid Howells 	__statfs_word f_bfree;
278a1ab315SDavid Howells 	__statfs_word f_bavail;
288a1ab315SDavid Howells 	__statfs_word f_files;
298a1ab315SDavid Howells 	__statfs_word f_ffree;
308a1ab315SDavid Howells 	__kernel_fsid_t f_fsid;
318a1ab315SDavid Howells 	__statfs_word f_namelen;
328a1ab315SDavid Howells 	__statfs_word f_frsize;
338a1ab315SDavid Howells 	__statfs_word f_flags;
348a1ab315SDavid Howells 	__statfs_word f_spare[4];
358a1ab315SDavid Howells };
368a1ab315SDavid Howells 
378a1ab315SDavid Howells /*
388a1ab315SDavid Howells  * ARM needs to avoid the 32-bit padding at the end, for consistency
398a1ab315SDavid Howells  * between EABI and OABI
408a1ab315SDavid Howells  */
418a1ab315SDavid Howells #ifndef ARCH_PACK_STATFS64
428a1ab315SDavid Howells #define ARCH_PACK_STATFS64
438a1ab315SDavid Howells #endif
448a1ab315SDavid Howells 
458a1ab315SDavid Howells struct statfs64 {
468a1ab315SDavid Howells 	__statfs_word f_type;
478a1ab315SDavid Howells 	__statfs_word f_bsize;
488a1ab315SDavid Howells 	__u64 f_blocks;
498a1ab315SDavid Howells 	__u64 f_bfree;
508a1ab315SDavid Howells 	__u64 f_bavail;
518a1ab315SDavid Howells 	__u64 f_files;
528a1ab315SDavid Howells 	__u64 f_ffree;
538a1ab315SDavid Howells 	__kernel_fsid_t f_fsid;
548a1ab315SDavid Howells 	__statfs_word f_namelen;
558a1ab315SDavid Howells 	__statfs_word f_frsize;
568a1ab315SDavid Howells 	__statfs_word f_flags;
578a1ab315SDavid Howells 	__statfs_word f_spare[4];
588a1ab315SDavid Howells } ARCH_PACK_STATFS64;
598a1ab315SDavid Howells 
608a1ab315SDavid Howells /*
618a1ab315SDavid Howells  * IA64 and x86_64 need to avoid the 32-bit padding at the end,
628a1ab315SDavid Howells  * to be compatible with the i386 ABI
638a1ab315SDavid Howells  */
648a1ab315SDavid Howells #ifndef ARCH_PACK_COMPAT_STATFS64
658a1ab315SDavid Howells #define ARCH_PACK_COMPAT_STATFS64
668a1ab315SDavid Howells #endif
678a1ab315SDavid Howells 
688a1ab315SDavid Howells struct compat_statfs64 {
698a1ab315SDavid Howells 	__u32 f_type;
708a1ab315SDavid Howells 	__u32 f_bsize;
718a1ab315SDavid Howells 	__u64 f_blocks;
728a1ab315SDavid Howells 	__u64 f_bfree;
738a1ab315SDavid Howells 	__u64 f_bavail;
748a1ab315SDavid Howells 	__u64 f_files;
758a1ab315SDavid Howells 	__u64 f_ffree;
768a1ab315SDavid Howells 	__kernel_fsid_t f_fsid;
778a1ab315SDavid Howells 	__u32 f_namelen;
788a1ab315SDavid Howells 	__u32 f_frsize;
798a1ab315SDavid Howells 	__u32 f_flags;
808a1ab315SDavid Howells 	__u32 f_spare[4];
818a1ab315SDavid Howells } ARCH_PACK_COMPAT_STATFS64;
828a1ab315SDavid Howells 
838a1ab315SDavid Howells #endif /* _UAPI_GENERIC_STATFS_H */
84