aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sandeen.net>2007-11-23 00:29:42 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-02-07 02:16:43 -0500
commit71ddabb94a623d1e16e7e66898bf439ff78ecc41 (patch)
treeded37e51148312db71e6a68b18c8bfca49b95112 /fs/xfs/xfs_bmap.c
parenta67d7c5f5d25d0b13a4dfb182697135b014fa478 (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_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index b02452b11456..aca51e7e5c5a 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -2969,7 +2969,7 @@ STATIC int
2969xfs_bmap_alloc( 2969xfs_bmap_alloc(
2970 xfs_bmalloca_t *ap) /* bmap alloc argument struct */ 2970 xfs_bmalloca_t *ap) /* bmap alloc argument struct */
2971{ 2971{
2972 if ((ap->ip->i_d.di_flags & XFS_DIFLAG_REALTIME) && ap->userdata) 2972 if (XFS_IS_REALTIME_INODE(ap->ip) && ap->userdata)
2973 return xfs_bmap_rtalloc(ap); 2973 return xfs_bmap_rtalloc(ap);
2974 return xfs_bmap_btalloc(ap); 2974 return xfs_bmap_btalloc(ap);
2975} 2975}
@@ -3096,8 +3096,7 @@ xfs_bmap_del_extent(
3096 /* 3096 /*
3097 * Realtime allocation. Free it and record di_nblocks update. 3097 * Realtime allocation. Free it and record di_nblocks update.
3098 */ 3098 */
3099 if (whichfork == XFS_DATA_FORK && 3099 if (whichfork == XFS_DATA_FORK && XFS_IS_REALTIME_INODE(ip)) {
3100 (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)) {
3101 xfs_fsblock_t bno; 3100 xfs_fsblock_t bno;
3102 xfs_filblks_t len; 3101 xfs_filblks_t len;
3103 3102