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_mount.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_mount.h')
-rw-r--r-- | fs/xfs/xfs_mount.h | 68 |
1 files changed, 26 insertions, 42 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 7341f4984c08..0567ee2164fa 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -80,6 +80,9 @@ struct xfs_iocore; | |||
80 | struct xfs_bmbt_irec; | 80 | struct xfs_bmbt_irec; |
81 | struct xfs_bmap_free; | 81 | struct xfs_bmap_free; |
82 | 82 | ||
83 | extern struct vfsops xfs_vfsops; | ||
84 | extern struct vnodeops xfs_vnodeops; | ||
85 | |||
83 | #define AIL_LOCK_T lock_t | 86 | #define AIL_LOCK_T lock_t |
84 | #define AIL_LOCKINIT(x,y) spinlock_init(x,y) | 87 | #define AIL_LOCKINIT(x,y) spinlock_init(x,y) |
85 | #define AIL_LOCK_DESTROY(x) spinlock_destroy(x) | 88 | #define AIL_LOCK_DESTROY(x) spinlock_destroy(x) |
@@ -503,57 +506,41 @@ xfs_preferred_iosize(xfs_mount_t *mp) | |||
503 | /* | 506 | /* |
504 | * Macros for getting from mount to vfs and back. | 507 | * Macros for getting from mount to vfs and back. |
505 | */ | 508 | */ |
506 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_MTOVFS) | ||
507 | struct vfs *xfs_mtovfs(xfs_mount_t *mp); | ||
508 | #define XFS_MTOVFS(mp) xfs_mtovfs(mp) | 509 | #define XFS_MTOVFS(mp) xfs_mtovfs(mp) |
509 | #else | 510 | static inline struct vfs *xfs_mtovfs(xfs_mount_t *mp) |
510 | #define XFS_MTOVFS(mp) (bhvtovfs(&(mp)->m_bhv)) | 511 | { |
511 | #endif | 512 | return bhvtovfs(&mp->m_bhv); |
512 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BHVTOM) | 513 | } |
513 | xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp); | ||
514 | #define XFS_BHVTOM(bdp) xfs_bhvtom(bdp) | ||
515 | #else | ||
516 | #define XFS_BHVTOM(bdp) ((xfs_mount_t *)BHV_PDATA(bdp)) | ||
517 | #endif | ||
518 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_VFSTOM) | ||
519 | xfs_mount_t *xfs_vfstom(vfs_t *vfs); | ||
520 | #define XFS_VFSTOM(vfs) xfs_vfstom(vfs) | ||
521 | #else | ||
522 | #define XFS_VFSTOM(vfs) \ | ||
523 | (XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfs), &xfs_vfsops))) | ||
524 | #endif | ||
525 | 514 | ||
515 | #define XFS_BHVTOM(bdp) xfs_bhvtom(bdp) | ||
516 | static inline xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp) | ||
517 | { | ||
518 | return (xfs_mount_t *)BHV_PDATA(bdp); | ||
519 | } | ||
526 | 520 | ||
527 | /* | 521 | #define XFS_VFSTOM(vfs) xfs_vfstom(vfs) |
528 | * Moved here from xfs_ag.h to avoid reordering header files | 522 | static inline xfs_mount_t *xfs_vfstom(vfs_t *vfs) |
529 | */ | 523 | { |
524 | return XFS_BHVTOM(bhv_lookup(VFS_BHVHEAD(vfs), &xfs_vfsops)); | ||
525 | } | ||
530 | 526 | ||
531 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGNO) | ||
532 | xfs_agnumber_t xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d); | ||
533 | #define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d) | 527 | #define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d) |
534 | #else | 528 | static inline xfs_agnumber_t |
535 | 529 | xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d) | |
536 | static inline xfs_agnumber_t XFS_DADDR_TO_AGNO(xfs_mount_t *mp, xfs_daddr_t d) | ||
537 | { | 530 | { |
538 | d = XFS_BB_TO_FSBT(mp, d); | 531 | xfs_daddr_t ld = XFS_BB_TO_FSBT(mp, d); |
539 | do_div(d, mp->m_sb.sb_agblocks); | 532 | do_div(ld, mp->m_sb.sb_agblocks); |
540 | return (xfs_agnumber_t) d; | 533 | return (xfs_agnumber_t) ld; |
541 | } | 534 | } |
542 | 535 | ||
543 | #endif | ||
544 | #if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DADDR_TO_AGBNO) | ||
545 | xfs_agblock_t xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d); | ||
546 | #define XFS_DADDR_TO_AGBNO(mp,d) xfs_daddr_to_agbno(mp,d) | 536 | #define XFS_DADDR_TO_AGBNO(mp,d) xfs_daddr_to_agbno(mp,d) |
547 | #else | 537 | static inline xfs_agblock_t |
548 | 538 | xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d) | |
549 | static inline xfs_agblock_t XFS_DADDR_TO_AGBNO(xfs_mount_t *mp, xfs_daddr_t d) | ||
550 | { | 539 | { |
551 | d = XFS_BB_TO_FSBT(mp, d); | 540 | xfs_daddr_t ld = XFS_BB_TO_FSBT(mp, d); |
552 | return (xfs_agblock_t) do_div(d, mp->m_sb.sb_agblocks); | 541 | return (xfs_agblock_t) do_div(ld, mp->m_sb.sb_agblocks); |
553 | } | 542 | } |
554 | 543 | ||
555 | #endif | ||
556 | |||
557 | /* | 544 | /* |
558 | * This structure is for use by the xfs_mod_incore_sb_batch() routine. | 545 | * This structure is for use by the xfs_mod_incore_sb_batch() routine. |
559 | */ | 546 | */ |
@@ -589,9 +576,6 @@ extern int xfs_sync_inodes(xfs_mount_t *, int, int, int *); | |||
589 | extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t); | 576 | extern xfs_agnumber_t xfs_initialize_perag(xfs_mount_t *, xfs_agnumber_t); |
590 | extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t); | 577 | extern void xfs_xlatesb(void *, struct xfs_sb *, int, __int64_t); |
591 | 578 | ||
592 | extern struct vfsops xfs_vfsops; | ||
593 | extern struct vnodeops xfs_vnodeops; | ||
594 | |||
595 | extern struct xfs_dmops xfs_dmcore_stub; | 579 | extern struct xfs_dmops xfs_dmcore_stub; |
596 | extern struct xfs_qmops xfs_qmcore_stub; | 580 | extern struct xfs_qmops xfs_qmcore_stub; |
597 | extern struct xfs_ioops xfs_iocore_xfs; | 581 | extern struct xfs_ioops xfs_iocore_xfs; |