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>
This commit is contained in:
Dave Chinner
2010-09-22 10:47:20 +10:00
committed by Alex Elder
parent 5adc94c247
commit ebad861b57
5 changed files with 20 additions and 21 deletions

View File

@@ -322,10 +322,11 @@ xlog_recover_iodone(
* this during recovery. One strike!
*/
xfs_ioerror_alert("xlog_recover_iodone",
bp->b_mount, bp, XFS_BUF_ADDR(bp));
xfs_force_shutdown(bp->b_mount, SHUTDOWN_META_IO_ERROR);
bp->b_target->bt_mount, bp,
XFS_BUF_ADDR(bp));
xfs_force_shutdown(bp->b_target->bt_mount,
SHUTDOWN_META_IO_ERROR);
}
bp->b_mount = NULL;
XFS_BUF_CLR_IODONE_FUNC(bp);
xfs_biodone(bp);
}
@@ -2276,8 +2277,7 @@ xlog_recover_do_buffer_trans(
XFS_BUF_STALE(bp);
error = xfs_bwrite(mp, bp);
} else {
ASSERT(bp->b_mount == NULL || bp->b_mount == mp);
bp->b_mount = mp;
ASSERT(bp->b_target->bt_mount == mp);
XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone);
xfs_bdwrite(mp, bp);
}
@@ -2541,8 +2541,7 @@ xlog_recover_do_inode_trans(
}
write_inode_buffer:
ASSERT(bp->b_mount == NULL || bp->b_mount == mp);
bp->b_mount = mp;
ASSERT(bp->b_target->bt_mount == mp);
XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone);
xfs_bdwrite(mp, bp);
error:
@@ -2679,8 +2678,7 @@ xlog_recover_do_dquot_trans(
memcpy(ddq, recddq, item->ri_buf[1].i_len);
ASSERT(dq_f->qlf_size == 2);
ASSERT(bp->b_mount == NULL || bp->b_mount == mp);
bp->b_mount = mp;
ASSERT(bp->b_target->bt_mount == mp);
XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone);
xfs_bdwrite(mp, bp);