diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2007-11-23 00:29:42 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-07 02:16:43 -0500 |
commit | 71ddabb94a623d1e16e7e66898bf439ff78ecc41 (patch) | |
tree | ded37e51148312db71e6a68b18c8bfca49b95112 /fs/xfs/xfs_iomap.c | |
parent | a67d7c5f5d25d0b13a4dfb182697135b014fa478 (diff) |
[XFS] optimize XFS_IS_REALTIME_INODE w/o realtime config
Use XFS_IS_REALTIME_INODE in more places, and #define it to 0 if
CONFIG_XFS_RT is off. This should be safe because mount checks in
xfs_rtmount_init:
so if we get mounted w/o CONFIG_XFS_RT, no realtime inodes should be
encountered after that.
Defining XFS_IS_REALTIME_INODE to 0 saves a bit of stack space,
presumeably gcc can optimize around the various "if (0)" type checks:
xfs_alloc_file_space -8 xfs_bmap_adjacent -16 xfs_bmapi -8
xfs_bmap_rtalloc -16 xfs_bunmapi -28 xfs_free_file_space -64 xfs_imap +8
<-- ? hmm. xfs_iomap_write_direct -12 xfs_qm_dqusage_adjust -4
xfs_qm_vop_chown_reserve -4
SGI-PV: 971186
SGI-Modid: xfs-linux-melb:xfs-kern:30014a
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r-- | fs/xfs/xfs_iomap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 637a24473f9b..fde37f87d52f 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c | |||
@@ -141,7 +141,7 @@ xfs_imap_to_bmap( | |||
141 | iomapp->iomap_bsize = XFS_FSB_TO_B(mp, imap->br_blockcount); | 141 | iomapp->iomap_bsize = XFS_FSB_TO_B(mp, imap->br_blockcount); |
142 | iomapp->iomap_flags = flags; | 142 | iomapp->iomap_flags = flags; |
143 | 143 | ||
144 | if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) { | 144 | if (XFS_IS_REALTIME_INODE(ip)) { |
145 | iomapp->iomap_flags |= IOMAP_REALTIME; | 145 | iomapp->iomap_flags |= IOMAP_REALTIME; |
146 | iomapp->iomap_target = mp->m_rtdev_targp; | 146 | iomapp->iomap_target = mp->m_rtdev_targp; |
147 | } else { | 147 | } else { |
@@ -298,7 +298,7 @@ xfs_iomap_eof_align_last_fsb( | |||
298 | xfs_extlen_t align; | 298 | xfs_extlen_t align; |
299 | int eof, error; | 299 | int eof, error; |
300 | 300 | ||
301 | if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) | 301 | if (XFS_IS_REALTIME_INODE(ip)) |
302 | ; | 302 | ; |
303 | /* | 303 | /* |
304 | * If mounted with the "-o swalloc" option, roundup the allocation | 304 | * If mounted with the "-o swalloc" option, roundup the allocation |
@@ -524,7 +524,7 @@ xfs_iomap_write_direct( | |||
524 | } | 524 | } |
525 | 525 | ||
526 | if (unlikely(!imap.br_startblock && | 526 | if (unlikely(!imap.br_startblock && |
527 | !(ip->i_d.di_flags & XFS_DIFLAG_REALTIME))) { | 527 | !(XFS_IS_REALTIME_INODE(ip)))) { |
528 | error = xfs_cmn_err_fsblock_zero(ip, &imap); | 528 | error = xfs_cmn_err_fsblock_zero(ip, &imap); |
529 | goto error_out; | 529 | goto error_out; |
530 | } | 530 | } |
@@ -687,7 +687,7 @@ retry: | |||
687 | } | 687 | } |
688 | 688 | ||
689 | if (unlikely(!imap[0].br_startblock && | 689 | if (unlikely(!imap[0].br_startblock && |
690 | !(ip->i_d.di_flags & XFS_DIFLAG_REALTIME))) | 690 | !(XFS_IS_REALTIME_INODE(ip)))) |
691 | return xfs_cmn_err_fsblock_zero(ip, &imap[0]); | 691 | return xfs_cmn_err_fsblock_zero(ip, &imap[0]); |
692 | 692 | ||
693 | *ret_imap = imap[0]; | 693 | *ret_imap = imap[0]; |
@@ -932,7 +932,7 @@ xfs_iomap_write_unwritten( | |||
932 | return XFS_ERROR(error); | 932 | return XFS_ERROR(error); |
933 | 933 | ||
934 | if (unlikely(!imap.br_startblock && | 934 | if (unlikely(!imap.br_startblock && |
935 | !(ip->i_d.di_flags & XFS_DIFLAG_REALTIME))) | 935 | !(XFS_IS_REALTIME_INODE(ip)))) |
936 | return xfs_cmn_err_fsblock_zero(ip, &imap); | 936 | return xfs_cmn_err_fsblock_zero(ip, &imap); |
937 | 937 | ||
938 | if ((numblks_fsb = imap.br_blockcount) == 0) { | 938 | if ((numblks_fsb = imap.br_blockcount) == 0) { |