aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap_btree.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-11-14 01:52:32 -0500
committerBen Myers <bpm@sgi.com>2012-11-15 22:35:02 -0500
commit612cfbfe174a89d565363fff7f3961a2dda5fb71 (patch)
tree46c44b5965ca17d8e47b1418158b2985ad12359e /fs/xfs/xfs_bmap_btree.c
parentcfb02852226aa449fe27075caffe88726507668c (diff)
xfs: add pre-write metadata buffer verifier callbacks
These verifiers are essentially the same code as the read verifiers, but do not require ioend processing. Hence factor the read verifier functions and add a new write verifier wrapper that is used as the callback. This is done as one large patch for all verifiers rather than one patch per verifier as the change is largely mechanical. This includes hooking up the write verifier via the read verifier function. Hooking up the write verifier for buffers obtained via xfs_trans_get_buf() will be done in a separate patch as that touches code in many different places rather than just the verifier functions. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_bmap_btree.c')
-rw-r--r--fs/xfs/xfs_bmap_btree.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
index bddca9b92869..17d7423e7503 100644
--- a/fs/xfs/xfs_bmap_btree.c
+++ b/fs/xfs/xfs_bmap_btree.c
@@ -708,8 +708,8 @@ xfs_bmbt_key_diff(
708 cur->bc_rec.b.br_startoff; 708 cur->bc_rec.b.br_startoff;
709} 709}
710 710
711void 711static void
712xfs_bmbt_read_verify( 712xfs_bmbt_verify(
713 struct xfs_buf *bp) 713 struct xfs_buf *bp)
714{ 714{
715 struct xfs_mount *mp = bp->b_target->bt_mount; 715 struct xfs_mount *mp = bp->b_target->bt_mount;
@@ -744,11 +744,24 @@ xfs_bmbt_read_verify(
744 744
745 if (!lblock_ok) { 745 if (!lblock_ok) {
746 trace_xfs_btree_corrupt(bp, _RET_IP_); 746 trace_xfs_btree_corrupt(bp, _RET_IP_);
747 XFS_CORRUPTION_ERROR("xfs_bmbt_read_verify", 747 XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, block);
748 XFS_ERRLEVEL_LOW, mp, block);
749 xfs_buf_ioerror(bp, EFSCORRUPTED); 748 xfs_buf_ioerror(bp, EFSCORRUPTED);
750 } 749 }
750}
751 751
752static void
753xfs_bmbt_write_verify(
754 struct xfs_buf *bp)
755{
756 xfs_bmbt_verify(bp);
757}
758
759void
760xfs_bmbt_read_verify(
761 struct xfs_buf *bp)
762{
763 xfs_bmbt_verify(bp);
764 bp->b_pre_io = xfs_bmbt_write_verify;
752 bp->b_iodone = NULL; 765 bp->b_iodone = NULL;
753 xfs_buf_ioend(bp, 0); 766 xfs_buf_ioend(bp, 0);
754} 767}