[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>
This commit is contained in:
committed by
Lachlan McIlroy
parent
a67d7c5f5d
commit
71ddabb94a
@@ -141,7 +141,7 @@ xfs_imap_to_bmap(
|
||||
iomapp->iomap_bsize = XFS_FSB_TO_B(mp, imap->br_blockcount);
|
||||
iomapp->iomap_flags = flags;
|
||||
|
||||
if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) {
|
||||
if (XFS_IS_REALTIME_INODE(ip)) {
|
||||
iomapp->iomap_flags |= IOMAP_REALTIME;
|
||||
iomapp->iomap_target = mp->m_rtdev_targp;
|
||||
} else {
|
||||
@@ -298,7 +298,7 @@ xfs_iomap_eof_align_last_fsb(
|
||||
xfs_extlen_t align;
|
||||
int eof, error;
|
||||
|
||||
if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)
|
||||
if (XFS_IS_REALTIME_INODE(ip))
|
||||
;
|
||||
/*
|
||||
* If mounted with the "-o swalloc" option, roundup the allocation
|
||||
@@ -524,7 +524,7 @@ xfs_iomap_write_direct(
|
||||
}
|
||||
|
||||
if (unlikely(!imap.br_startblock &&
|
||||
!(ip->i_d.di_flags & XFS_DIFLAG_REALTIME))) {
|
||||
!(XFS_IS_REALTIME_INODE(ip)))) {
|
||||
error = xfs_cmn_err_fsblock_zero(ip, &imap);
|
||||
goto error_out;
|
||||
}
|
||||
@@ -687,7 +687,7 @@ retry:
|
||||
}
|
||||
|
||||
if (unlikely(!imap[0].br_startblock &&
|
||||
!(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)))
|
||||
!(XFS_IS_REALTIME_INODE(ip))))
|
||||
return xfs_cmn_err_fsblock_zero(ip, &imap[0]);
|
||||
|
||||
*ret_imap = imap[0];
|
||||
@@ -932,7 +932,7 @@ xfs_iomap_write_unwritten(
|
||||
return XFS_ERROR(error);
|
||||
|
||||
if (unlikely(!imap.br_startblock &&
|
||||
!(ip->i_d.di_flags & XFS_DIFLAG_REALTIME)))
|
||||
!(XFS_IS_REALTIME_INODE(ip))))
|
||||
return xfs_cmn_err_fsblock_zero(ip, &imap);
|
||||
|
||||
if ((numblks_fsb = imap.br_blockcount) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user