diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_linux.h')
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_linux.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h index aa26ab906c88..2b0e0018738a 100644 --- a/fs/xfs/linux-2.6/xfs_linux.h +++ b/fs/xfs/linux-2.6/xfs_linux.h | |||
| @@ -19,7 +19,6 @@ | |||
| 19 | #define __XFS_LINUX__ | 19 | #define __XFS_LINUX__ |
| 20 | 20 | ||
| 21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
| 22 | #include <linux/config.h> | ||
| 23 | 22 | ||
| 24 | /* | 23 | /* |
| 25 | * Some types are conditional depending on the target system. | 24 | * Some types are conditional depending on the target system. |
| @@ -140,9 +139,7 @@ BUFFER_FNS(PrivateStart, unwritten); | |||
| 140 | #define current_pid() (current->pid) | 139 | #define current_pid() (current->pid) |
| 141 | #define current_fsuid(cred) (current->fsuid) | 140 | #define current_fsuid(cred) (current->fsuid) |
| 142 | #define current_fsgid(cred) (current->fsgid) | 141 | #define current_fsgid(cred) (current->fsgid) |
| 143 | #define current_set_flags(f) (current->flags |= (f)) | ||
| 144 | #define current_test_flags(f) (current->flags & (f)) | 142 | #define current_test_flags(f) (current->flags & (f)) |
| 145 | #define current_clear_flags(f) (current->flags & ~(f)) | ||
| 146 | #define current_set_flags_nested(sp, f) \ | 143 | #define current_set_flags_nested(sp, f) \ |
| 147 | (*(sp) = current->flags, current->flags |= (f)) | 144 | (*(sp) = current->flags, current->flags |= (f)) |
| 148 | #define current_clear_flags_nested(sp, f) \ | 145 | #define current_clear_flags_nested(sp, f) \ |
| @@ -151,11 +148,7 @@ BUFFER_FNS(PrivateStart, unwritten); | |||
| 151 | (current->flags = ((current->flags & ~(f)) | (*(sp) & (f)))) | 148 | (current->flags = ((current->flags & ~(f)) | (*(sp) & (f)))) |
| 152 | 149 | ||
| 153 | #define NBPP PAGE_SIZE | 150 | #define NBPP PAGE_SIZE |
| 154 | #define DPPSHFT (PAGE_SHIFT - 9) | ||
| 155 | #define NDPP (1 << (PAGE_SHIFT - 9)) | 151 | #define NDPP (1 << (PAGE_SHIFT - 9)) |
| 156 | #define dtop(DD) (((DD) + NDPP - 1) >> DPPSHFT) | ||
| 157 | #define dtopt(DD) ((DD) >> DPPSHFT) | ||
| 158 | #define dpoff(DD) ((DD) & (NDPP-1)) | ||
| 159 | 152 | ||
| 160 | #define NBBY 8 /* number of bits per byte */ | 153 | #define NBBY 8 /* number of bits per byte */ |
| 161 | #define NBPC PAGE_SIZE /* Number of bytes per click */ | 154 | #define NBPC PAGE_SIZE /* Number of bytes per click */ |
| @@ -175,8 +168,6 @@ BUFFER_FNS(PrivateStart, unwritten); | |||
| 175 | #define btoct(x) ((__psunsigned_t)(x)>>BPCSHIFT) | 168 | #define btoct(x) ((__psunsigned_t)(x)>>BPCSHIFT) |
| 176 | #define btoc64(x) (((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT) | 169 | #define btoc64(x) (((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT) |
| 177 | #define btoct64(x) ((__uint64_t)(x)>>BPCSHIFT) | 170 | #define btoct64(x) ((__uint64_t)(x)>>BPCSHIFT) |
| 178 | #define io_btoc(x) (((__psunsigned_t)(x)+(IO_NBPC-1))>>IO_BPCSHIFT) | ||
| 179 | #define io_btoct(x) ((__psunsigned_t)(x)>>IO_BPCSHIFT) | ||
| 180 | 171 | ||
| 181 | /* off_t bytes to clicks */ | 172 | /* off_t bytes to clicks */ |
| 182 | #define offtoc(x) (((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT) | 173 | #define offtoc(x) (((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT) |
| @@ -189,7 +180,6 @@ BUFFER_FNS(PrivateStart, unwritten); | |||
| 189 | #define ctob(x) ((__psunsigned_t)(x)<<BPCSHIFT) | 180 | #define ctob(x) ((__psunsigned_t)(x)<<BPCSHIFT) |
| 190 | #define btoct(x) ((__psunsigned_t)(x)>>BPCSHIFT) | 181 | #define btoct(x) ((__psunsigned_t)(x)>>BPCSHIFT) |
| 191 | #define ctob64(x) ((__uint64_t)(x)<<BPCSHIFT) | 182 | #define ctob64(x) ((__uint64_t)(x)<<BPCSHIFT) |
| 192 | #define io_ctob(x) ((__psunsigned_t)(x)<<IO_BPCSHIFT) | ||
| 193 | 183 | ||
| 194 | /* bytes to clicks */ | 184 | /* bytes to clicks */ |
| 195 | #define btoc(x) (((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT) | 185 | #define btoc(x) (((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT) |
| @@ -218,7 +208,6 @@ BUFFER_FNS(PrivateStart, unwritten); | |||
| 218 | #define MIN(a,b) (min(a,b)) | 208 | #define MIN(a,b) (min(a,b)) |
| 219 | #define MAX(a,b) (max(a,b)) | 209 | #define MAX(a,b) (max(a,b)) |
| 220 | #define howmany(x, y) (((x)+((y)-1))/(y)) | 210 | #define howmany(x, y) (((x)+((y)-1))/(y)) |
| 221 | #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) | ||
| 222 | 211 | ||
| 223 | /* | 212 | /* |
| 224 | * Various platform dependent calls that don't fit anywhere else | 213 | * Various platform dependent calls that don't fit anywhere else |
| @@ -343,4 +332,11 @@ static inline __uint64_t roundup_64(__uint64_t x, __uint32_t y) | |||
| 343 | return(x * y); | 332 | return(x * y); |
| 344 | } | 333 | } |
| 345 | 334 | ||
| 335 | static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y) | ||
| 336 | { | ||
| 337 | x += y - 1; | ||
| 338 | do_div(x, y); | ||
| 339 | return x; | ||
| 340 | } | ||
| 341 | |||
| 346 | #endif /* __XFS_LINUX__ */ | 342 | #endif /* __XFS_LINUX__ */ |
