aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_buf.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2010-09-21 20:47:20 -0400
committerAlex Elder <aelder@sgi.com>2010-10-18 16:07:48 -0400
commitebad861b5702c3e2332a3e906978f47144d22f70 (patch)
tree7b4502277c46d26d1d26258d05596b58ab6b868a /fs/xfs/linux-2.6/xfs_buf.c
parent5adc94c247c3779782c7b0b8b5e28cf50596eb37 (diff)
xfs: store xfs_mount in the buftarg instead of in the xfs_buf
Each buffer contains both a buftarg pointer and a mount pointer. If we add a mount pointer into the buftarg, we can avoid needing the b_mount field in every buffer and grab it from the buftarg when needed instead. This shrinks the xfs_buf by 8 bytes. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_buf.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index 22c7bff77ad2..d6928970097f 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -894,7 +894,7 @@ xfs_buf_lock(
894 trace_xfs_buf_lock(bp, _RET_IP_); 894 trace_xfs_buf_lock(bp, _RET_IP_);
895 895
896 if (atomic_read(&bp->b_pin_count) && (bp->b_flags & XBF_STALE)) 896 if (atomic_read(&bp->b_pin_count) && (bp->b_flags & XBF_STALE))
897 xfs_log_force(bp->b_mount, 0); 897 xfs_log_force(bp->b_target->bt_mount, 0);
898 if (atomic_read(&bp->b_io_remaining)) 898 if (atomic_read(&bp->b_io_remaining))
899 blk_run_address_space(bp->b_target->bt_mapping); 899 blk_run_address_space(bp->b_target->bt_mapping);
900 down(&bp->b_sema); 900 down(&bp->b_sema);
@@ -1017,7 +1017,6 @@ xfs_bwrite(
1017{ 1017{
1018 int error; 1018 int error;
1019 1019
1020 bp->b_mount = mp;
1021 bp->b_flags |= XBF_WRITE; 1020 bp->b_flags |= XBF_WRITE;
1022 bp->b_flags &= ~(XBF_ASYNC | XBF_READ); 1021 bp->b_flags &= ~(XBF_ASYNC | XBF_READ);
1023 1022
@@ -1038,8 +1037,6 @@ xfs_bdwrite(
1038{ 1037{
1039 trace_xfs_buf_bdwrite(bp, _RET_IP_); 1038 trace_xfs_buf_bdwrite(bp, _RET_IP_);
1040 1039
1041 bp->b_mount = mp;
1042
1043 bp->b_flags &= ~XBF_READ; 1040 bp->b_flags &= ~XBF_READ;
1044 bp->b_flags |= (XBF_DELWRI | XBF_ASYNC); 1041 bp->b_flags |= (XBF_DELWRI | XBF_ASYNC);
1045 1042
@@ -1128,7 +1125,7 @@ int
1128xfs_bdstrat_cb( 1125xfs_bdstrat_cb(
1129 struct xfs_buf *bp) 1126 struct xfs_buf *bp)
1130{ 1127{
1131 if (XFS_FORCED_SHUTDOWN(bp->b_mount)) { 1128 if (XFS_FORCED_SHUTDOWN(bp->b_target->bt_mount)) {
1132 trace_xfs_bdstrat_shut(bp, _RET_IP_); 1129 trace_xfs_bdstrat_shut(bp, _RET_IP_);
1133 /* 1130 /*
1134 * Metadata write that didn't get logged but 1131 * Metadata write that didn't get logged but
@@ -1644,6 +1641,7 @@ out_error:
1644 1641
1645xfs_buftarg_t * 1642xfs_buftarg_t *
1646xfs_alloc_buftarg( 1643xfs_alloc_buftarg(
1644 struct xfs_mount *mp,
1647 struct block_device *bdev, 1645 struct block_device *bdev,
1648 int external, 1646 int external,
1649 const char *fsname) 1647 const char *fsname)
@@ -1652,6 +1650,7 @@ xfs_alloc_buftarg(
1652 1650
1653 btp = kmem_zalloc(sizeof(*btp), KM_SLEEP); 1651 btp = kmem_zalloc(sizeof(*btp), KM_SLEEP);
1654 1652
1653 btp->bt_mount = mp;
1655 btp->bt_dev = bdev->bd_dev; 1654 btp->bt_dev = bdev->bd_dev;
1656 btp->bt_bdev = bdev; 1655 btp->bt_bdev = bdev;
1657 if (xfs_setsize_buftarg_early(btp, bdev)) 1656 if (xfs_setsize_buftarg_early(btp, bdev))