diff options
author | Nathan Scott <nathans@sgi.com> | 2005-11-01 22:38:42 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-11-01 22:38:42 -0500 |
commit | a844f4510dce23c07f3923cb42138f5fdd745017 (patch) | |
tree | ffb37e9e60f02d5e92bd69bb53b568e1c991c17f /fs/xfs/xfs_inode.h | |
parent | 61c1e689fbde7cb50a76262bba190715d86beab6 (diff) |
[XFS] Remove xfs_macros.c, xfs_macros.h, rework headers a whole lot.
SGI-PV: 943122
SGI-Modid: xfs-linux:xfs-kern:23901a
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r-- | fs/xfs/xfs_inode.h | 75 |
1 files changed, 10 insertions, 65 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 6ec8a0dd84a8..11be922698af 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -33,6 +33,12 @@ | |||
33 | #define __XFS_INODE_H__ | 33 | #define __XFS_INODE_H__ |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * Fork identifiers. | ||
37 | */ | ||
38 | #define XFS_DATA_FORK 0 | ||
39 | #define XFS_ATTR_FORK 1 | ||
40 | |||
41 | /* | ||
36 | * File incore extent information, present for each of data & attr forks. | 42 | * File incore extent information, present for each of data & attr forks. |
37 | */ | 43 | */ |
38 | #define XFS_INLINE_EXTS 2 | 44 | #define XFS_INLINE_EXTS 2 |
@@ -311,60 +317,16 @@ typedef struct xfs_inode { | |||
311 | /* | 317 | /* |
312 | * Fork handling. | 318 | * Fork handling. |
313 | */ | 319 | */ |
314 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_PTR) | 320 | #define XFS_IFORK_PTR(ip,w) \ |
315 | xfs_ifork_t *xfs_ifork_ptr(xfs_inode_t *ip, int w); | 321 | ((w) == XFS_DATA_FORK ? &(ip)->i_df : (ip)->i_afp) |
316 | #define XFS_IFORK_PTR(ip,w) xfs_ifork_ptr(ip,w) | ||
317 | #else | ||
318 | #define XFS_IFORK_PTR(ip,w) ((w) == XFS_DATA_FORK ? &(ip)->i_df : (ip)->i_afp) | ||
319 | #endif | ||
320 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_Q) | ||
321 | int xfs_ifork_q(xfs_inode_t *ip); | ||
322 | #define XFS_IFORK_Q(ip) xfs_ifork_q(ip) | ||
323 | #else | ||
324 | #define XFS_IFORK_Q(ip) XFS_CFORK_Q(&(ip)->i_d) | 322 | #define XFS_IFORK_Q(ip) XFS_CFORK_Q(&(ip)->i_d) |
325 | #endif | ||
326 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_DSIZE) | ||
327 | int xfs_ifork_dsize(xfs_inode_t *ip); | ||
328 | #define XFS_IFORK_DSIZE(ip) xfs_ifork_dsize(ip) | ||
329 | #else | ||
330 | #define XFS_IFORK_DSIZE(ip) XFS_CFORK_DSIZE(&ip->i_d, ip->i_mount) | 323 | #define XFS_IFORK_DSIZE(ip) XFS_CFORK_DSIZE(&ip->i_d, ip->i_mount) |
331 | #endif | ||
332 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_ASIZE) | ||
333 | int xfs_ifork_asize(xfs_inode_t *ip); | ||
334 | #define XFS_IFORK_ASIZE(ip) xfs_ifork_asize(ip) | ||
335 | #else | ||
336 | #define XFS_IFORK_ASIZE(ip) XFS_CFORK_ASIZE(&ip->i_d, ip->i_mount) | 324 | #define XFS_IFORK_ASIZE(ip) XFS_CFORK_ASIZE(&ip->i_d, ip->i_mount) |
337 | #endif | ||
338 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_SIZE) | ||
339 | int xfs_ifork_size(xfs_inode_t *ip, int w); | ||
340 | #define XFS_IFORK_SIZE(ip,w) xfs_ifork_size(ip,w) | ||
341 | #else | ||
342 | #define XFS_IFORK_SIZE(ip,w) XFS_CFORK_SIZE(&ip->i_d, ip->i_mount, w) | 325 | #define XFS_IFORK_SIZE(ip,w) XFS_CFORK_SIZE(&ip->i_d, ip->i_mount, w) |
343 | #endif | ||
344 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_FORMAT) | ||
345 | int xfs_ifork_format(xfs_inode_t *ip, int w); | ||
346 | #define XFS_IFORK_FORMAT(ip,w) xfs_ifork_format(ip,w) | ||
347 | #else | ||
348 | #define XFS_IFORK_FORMAT(ip,w) XFS_CFORK_FORMAT(&ip->i_d, w) | 326 | #define XFS_IFORK_FORMAT(ip,w) XFS_CFORK_FORMAT(&ip->i_d, w) |
349 | #endif | ||
350 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_FMT_SET) | ||
351 | void xfs_ifork_fmt_set(xfs_inode_t *ip, int w, int n); | ||
352 | #define XFS_IFORK_FMT_SET(ip,w,n) xfs_ifork_fmt_set(ip,w,n) | ||
353 | #else | ||
354 | #define XFS_IFORK_FMT_SET(ip,w,n) XFS_CFORK_FMT_SET(&ip->i_d, w, n) | 327 | #define XFS_IFORK_FMT_SET(ip,w,n) XFS_CFORK_FMT_SET(&ip->i_d, w, n) |
355 | #endif | ||
356 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_NEXTENTS) | ||
357 | int xfs_ifork_nextents(xfs_inode_t *ip, int w); | ||
358 | #define XFS_IFORK_NEXTENTS(ip,w) xfs_ifork_nextents(ip,w) | ||
359 | #else | ||
360 | #define XFS_IFORK_NEXTENTS(ip,w) XFS_CFORK_NEXTENTS(&ip->i_d, w) | 328 | #define XFS_IFORK_NEXTENTS(ip,w) XFS_CFORK_NEXTENTS(&ip->i_d, w) |
361 | #endif | ||
362 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_IFORK_NEXT_SET) | ||
363 | void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n); | ||
364 | #define XFS_IFORK_NEXT_SET(ip,w,n) xfs_ifork_next_set(ip,w,n) | ||
365 | #else | ||
366 | #define XFS_IFORK_NEXT_SET(ip,w,n) XFS_CFORK_NEXT_SET(&ip->i_d, w, n) | 329 | #define XFS_IFORK_NEXT_SET(ip,w,n) XFS_CFORK_NEXT_SET(&ip->i_d, w, n) |
367 | #endif | ||
368 | 330 | ||
369 | 331 | ||
370 | #ifdef __KERNEL__ | 332 | #ifdef __KERNEL__ |
@@ -418,28 +380,11 @@ void xfs_ifork_next_set(xfs_inode_t *ip, int w, int n); | |||
418 | #define XFS_ITRUNC_DEFINITE 0x1 | 380 | #define XFS_ITRUNC_DEFINITE 0x1 |
419 | #define XFS_ITRUNC_MAYBE 0x2 | 381 | #define XFS_ITRUNC_MAYBE 0x2 |
420 | 382 | ||
421 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ITOV) | ||
422 | struct vnode *xfs_itov(xfs_inode_t *ip); | ||
423 | #define XFS_ITOV(ip) xfs_itov(ip) | ||
424 | #else | ||
425 | #define XFS_ITOV(ip) BHV_TO_VNODE(XFS_ITOBHV(ip)) | 383 | #define XFS_ITOV(ip) BHV_TO_VNODE(XFS_ITOBHV(ip)) |
426 | #endif | ||
427 | #define XFS_ITOV_NULL(ip) BHV_TO_VNODE_NULL(XFS_ITOBHV(ip)) | 384 | #define XFS_ITOV_NULL(ip) BHV_TO_VNODE_NULL(XFS_ITOBHV(ip)) |
428 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_ITOBHV) | ||
429 | struct bhv_desc *xfs_itobhv(xfs_inode_t *ip); | ||
430 | #define XFS_ITOBHV(ip) xfs_itobhv(ip) | ||
431 | #else | ||
432 | #define XFS_ITOBHV(ip) ((struct bhv_desc *)(&((ip)->i_bhv_desc))) | 385 | #define XFS_ITOBHV(ip) ((struct bhv_desc *)(&((ip)->i_bhv_desc))) |
433 | #endif | 386 | #define XFS_BHVTOI(bhvp) ((xfs_inode_t *)((char *)(bhvp) - \ |
434 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BHVTOI) | 387 | (char *)&(((xfs_inode_t *)0)->i_bhv_desc))) |
435 | xfs_inode_t *xfs_bhvtoi(struct bhv_desc *bhvp); | ||
436 | #define XFS_BHVTOI(bhvp) xfs_bhvtoi(bhvp) | ||
437 | #else | ||
438 | #define XFS_BHVTOI(bhvp) \ | ||
439 | ((xfs_inode_t *)((char *)(bhvp) - \ | ||
440 | (char *)&(((xfs_inode_t *)0)->i_bhv_desc))) | ||
441 | #endif | ||
442 | |||
443 | #define BHV_IS_XFS(bdp) (BHV_OPS(bdp) == &xfs_vnodeops) | 388 | #define BHV_IS_XFS(bdp) (BHV_OPS(bdp) == &xfs_vnodeops) |
444 | 389 | ||
445 | /* | 390 | /* |