diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2008-09-01 09:07:11 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-09-04 04:46:08 -0400 |
commit | 92a7507926b0698711ed010288b57582776eec31 (patch) | |
tree | e0ab785a101838be177f8b7f75c1641c2805875f /include | |
parent | aa7a7fb3990ffc74945494cbd2fc6e920825ee2c (diff) |
Make <asm-generic/statfs.h> suitable for 64-bit platforms.
At the moment, 64-bit platforms (other than Alpha) are all redefining
things for themselves instead of using <asm-generic/statfs.h>.
As is ARM, since it has special requirements w.r.t. padding.
Make <asm-generic/statfs.h> more generic, and they can use it directly.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/statfs.h | 65 |
1 files changed, 48 insertions, 17 deletions
diff --git a/include/asm-generic/statfs.h b/include/asm-generic/statfs.h index 1d01043e797d..6129d6802149 100644 --- a/include/asm-generic/statfs.h +++ b/include/asm-generic/statfs.h | |||
@@ -6,33 +6,64 @@ | |||
6 | typedef __kernel_fsid_t fsid_t; | 6 | typedef __kernel_fsid_t fsid_t; |
7 | #endif | 7 | #endif |
8 | 8 | ||
9 | /* | ||
10 | * Most 64-bit platforms use 'long', while most 32-bit platforms use '__u32'. | ||
11 | * Yes, they differ in signedness as well as size. | ||
12 | * Special cases can override it for themselves -- except for S390x, which | ||
13 | * is just a little too special for us. And MIPS, which I'm not touching | ||
14 | * with a 10' pole. | ||
15 | */ | ||
16 | #ifndef __statfs_word | ||
17 | #if BITS_PER_LONG == 64 | ||
18 | #define __statfs_word long | ||
19 | #else | ||
20 | #define __statfs_word __u32 | ||
21 | #endif | ||
22 | #endif | ||
23 | |||
9 | struct statfs { | 24 | struct statfs { |
10 | __u32 f_type; | 25 | __statfs_word f_type; |
11 | __u32 f_bsize; | 26 | __statfs_word f_bsize; |
12 | __u32 f_blocks; | 27 | __statfs_word f_blocks; |
13 | __u32 f_bfree; | 28 | __statfs_word f_bfree; |
14 | __u32 f_bavail; | 29 | __statfs_word f_bavail; |
15 | __u32 f_files; | 30 | __statfs_word f_files; |
16 | __u32 f_ffree; | 31 | __statfs_word f_ffree; |
17 | __kernel_fsid_t f_fsid; | 32 | __kernel_fsid_t f_fsid; |
18 | __u32 f_namelen; | 33 | __statfs_word f_namelen; |
19 | __u32 f_frsize; | 34 | __statfs_word f_frsize; |
20 | __u32 f_spare[5]; | 35 | __statfs_word f_spare[5]; |
21 | }; | 36 | }; |
22 | 37 | ||
38 | /* | ||
39 | * ARM needs to avoid the 32-bit padding at the end, for consistency | ||
40 | * between EABI and OABI | ||
41 | */ | ||
42 | #ifndef ARCH_PACK_STATFS64 | ||
43 | #define ARCH_PACK_STATFS64 | ||
44 | #endif | ||
45 | |||
23 | struct statfs64 { | 46 | struct statfs64 { |
24 | __u32 f_type; | 47 | __statfs_word f_type; |
25 | __u32 f_bsize; | 48 | __statfs_word f_bsize; |
26 | __u64 f_blocks; | 49 | __u64 f_blocks; |
27 | __u64 f_bfree; | 50 | __u64 f_bfree; |
28 | __u64 f_bavail; | 51 | __u64 f_bavail; |
29 | __u64 f_files; | 52 | __u64 f_files; |
30 | __u64 f_ffree; | 53 | __u64 f_ffree; |
31 | __kernel_fsid_t f_fsid; | 54 | __kernel_fsid_t f_fsid; |
32 | __u32 f_namelen; | 55 | __statfs_word f_namelen; |
33 | __u32 f_frsize; | 56 | __statfs_word f_frsize; |
34 | __u32 f_spare[5]; | 57 | __statfs_word f_spare[5]; |
35 | }; | 58 | } ARCH_PACK_STATFS64; |
59 | |||
60 | /* | ||
61 | * IA64 and x86_64 need to avoid the 32-bit padding at the end, | ||
62 | * to be compatible with the i386 ABI | ||
63 | */ | ||
64 | #ifndef ARCH_PACK_COMPAT_STATFS64 | ||
65 | #define ARCH_PACK_COMPAT_STATFS64 | ||
66 | #endif | ||
36 | 67 | ||
37 | struct compat_statfs64 { | 68 | struct compat_statfs64 { |
38 | __u32 f_type; | 69 | __u32 f_type; |
@@ -46,6 +77,6 @@ struct compat_statfs64 { | |||
46 | __u32 f_namelen; | 77 | __u32 f_namelen; |
47 | __u32 f_frsize; | 78 | __u32 f_frsize; |
48 | __u32 f_spare[5]; | 79 | __u32 f_spare[5]; |
49 | }; | 80 | } ARCH_PACK_COMPAT_STATFS64; |
50 | 81 | ||
51 | #endif | 82 | #endif |