aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
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/linux-2.6
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/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c4
4 files changed, 5 insertions, 5 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 36dadc4ff22c..e0519529c26c 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -113,7 +113,7 @@ xfs_find_bdev_for_inode(
113{ 113{
114 struct xfs_mount *mp = ip->i_mount; 114 struct xfs_mount *mp = ip->i_mount;
115 115
116 if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) 116 if (XFS_IS_REALTIME_INODE(ip))
117 return mp->m_rtdev_targp->bt_bdev; 117 return mp->m_rtdev_targp->bt_bdev;
118 else 118 else
119 return mp->m_ddev_targp->bt_bdev; 119 return mp->m_ddev_targp->bt_bdev;
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index daa351a0a03d..4c82a050a3a8 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -741,7 +741,7 @@ xfs_ioctl(
741 case XFS_IOC_DIOINFO: { 741 case XFS_IOC_DIOINFO: {
742 struct dioattr da; 742 struct dioattr da;
743 xfs_buftarg_t *target = 743 xfs_buftarg_t *target =
744 (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? 744 XFS_IS_REALTIME_INODE(ip) ?
745 mp->m_rtdev_targp : mp->m_ddev_targp; 745 mp->m_rtdev_targp : mp->m_ddev_targp;
746 746
747 da.d_mem = da.d_miniosz = 1 << target->bt_sshift; 747 da.d_mem = da.d_miniosz = 1 << target->bt_sshift;
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 9ddef91a436d..1ecd86a8c6e6 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -612,7 +612,7 @@ xfs_vn_getattr(
612 sysv_minor(ip->i_df.if_u2.if_rdev)); 612 sysv_minor(ip->i_df.if_u2.if_rdev));
613 break; 613 break;
614 default: 614 default:
615 if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) { 615 if (XFS_IS_REALTIME_INODE(ip)) {
616 /* 616 /*
617 * If the file blocks are being allocated from a 617 * If the file blocks are being allocated from a
618 * realtime volume, then return the inode's realtime 618 * realtime volume, then return the inode's realtime
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index 459d36480b16..19a1f077dbd6 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -202,7 +202,7 @@ xfs_read(
202 202
203 if (unlikely(ioflags & IO_ISDIRECT)) { 203 if (unlikely(ioflags & IO_ISDIRECT)) {
204 xfs_buftarg_t *target = 204 xfs_buftarg_t *target =
205 (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? 205 XFS_IS_REALTIME_INODE(ip) ?
206 mp->m_rtdev_targp : mp->m_ddev_targp; 206 mp->m_rtdev_targp : mp->m_ddev_targp;
207 if ((*offset & target->bt_smask) || 207 if ((*offset & target->bt_smask) ||
208 (size & target->bt_smask)) { 208 (size & target->bt_smask)) {
@@ -657,7 +657,7 @@ start:
657 657
658 if (ioflags & IO_ISDIRECT) { 658 if (ioflags & IO_ISDIRECT) {
659 xfs_buftarg_t *target = 659 xfs_buftarg_t *target =
660 (xip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? 660 XFS_IS_REALTIME_INODE(xip) ?
661 mp->m_rtdev_targp : mp->m_ddev_targp; 661 mp->m_rtdev_targp : mp->m_ddev_targp;
662 662
663 if ((pos & target->bt_smask) || (count & target->bt_smask)) { 663 if ((pos & target->bt_smask) || (count & target->bt_smask)) {