summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-11-14 17:54:40 +1100
committerBen Myers <bpm@sgi.com>2012-11-15 21:35:12 -0600
commit1813dd64057490e7a0678a885c4fe6d02f78bdc1 (patch)
treecaf95e2be7881b771da65561b2f1664d73588401 /fs/xfs/xfs_bmap.c
parentb0f539de9fcc543a3ffa40bc22bf51aca6ea6183 (diff)
xfs: convert buffer verifiers to an ops structure.
To separate the verifiers from iodone functions and associate read and write verifiers at the same time, introduce a buffer verifier operations structure to the xfs_buf. This avoids the need for assigning the write verifier, clearing the iodone function and re-running ioend processing in the read verifier, and gets rid of the nasty "b_pre_io" name for the write verifier function pointer. If we ever need to, it will also be easier to add further content specific callbacks to a buffer with an ops structure in place. We also avoid needing to export verifier functions, instead we can simply export the ops structures for those that are needed outside the function they are defined in. This patch also fixes a directory block readahead verifier issue it exposed. This patch also adds ops callbacks to the inode/alloc btree blocks initialised by growfs. These will need more work before they will work with CRCs. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Phil White <pwhite@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 6a0f3f9f39d3..0e92d12765d2 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -2663,7 +2663,7 @@ xfs_bmap_btree_to_extents(
return error;
#endif
error = xfs_btree_read_bufl(mp, tp, cbno, 0, &cbp, XFS_BMAP_BTREE_REF,
- xfs_bmbt_read_verify);
+ &xfs_bmbt_buf_ops);
if (error)
return error;
cblock = XFS_BUF_TO_BLOCK(cbp);
@@ -3124,7 +3124,7 @@ xfs_bmap_extents_to_btree(
/*
* Fill in the child block.
*/
- abp->b_pre_io = xfs_bmbt_write_verify;
+ abp->b_ops = &xfs_bmbt_buf_ops;
ablock = XFS_BUF_TO_BLOCK(abp);
ablock->bb_magic = cpu_to_be32(XFS_BMAP_MAGIC);
ablock->bb_level = 0;
@@ -3271,7 +3271,7 @@ xfs_bmap_local_to_extents(
ASSERT(args.len == 1);
*firstblock = args.fsbno;
bp = xfs_btree_get_bufl(args.mp, tp, args.fsbno, 0);
- bp->b_pre_io = xfs_bmbt_write_verify;
+ bp->b_ops = &xfs_bmbt_buf_ops;
memcpy(bp->b_addr, ifp->if_u1.if_data, ifp->if_bytes);
xfs_trans_log_buf(tp, bp, 0, ifp->if_bytes - 1);
xfs_bmap_forkoff_reset(args.mp, ip, whichfork);
@@ -4082,7 +4082,7 @@ xfs_bmap_read_extents(
*/
while (level-- > 0) {
error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp,
- XFS_BMAP_BTREE_REF, xfs_bmbt_read_verify);
+ XFS_BMAP_BTREE_REF, &xfs_bmbt_buf_ops);
if (error)
return error;
block = XFS_BUF_TO_BLOCK(bp);
@@ -4129,7 +4129,7 @@ xfs_bmap_read_extents(
nextbno = be64_to_cpu(block->bb_u.l.bb_rightsib);
if (nextbno != NULLFSBLOCK)
xfs_btree_reada_bufl(mp, nextbno, 1,
- xfs_bmbt_read_verify);
+ &xfs_bmbt_buf_ops);
/*
* Copy records into the extent records.
*/
@@ -4162,7 +4162,7 @@ xfs_bmap_read_extents(
if (bno == NULLFSBLOCK)
break;
error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp,
- XFS_BMAP_BTREE_REF, xfs_bmbt_read_verify);
+ XFS_BMAP_BTREE_REF, &xfs_bmbt_buf_ops);
if (error)
return error;
block = XFS_BUF_TO_BLOCK(bp);
@@ -5880,7 +5880,7 @@ xfs_bmap_check_leaf_extents(
bp_release = 1;
error = xfs_btree_read_bufl(mp, NULL, bno, 0, &bp,
XFS_BMAP_BTREE_REF,
- xfs_bmbt_read_verify);
+ &xfs_bmbt_buf_ops);
if (error)
goto error_norelse;
}
@@ -5966,7 +5966,7 @@ xfs_bmap_check_leaf_extents(
bp_release = 1;
error = xfs_btree_read_bufl(mp, NULL, bno, 0, &bp,
XFS_BMAP_BTREE_REF,
- xfs_bmbt_read_verify);
+ &xfs_bmbt_buf_ops);
if (error)
goto error_norelse;
}
@@ -6061,7 +6061,7 @@ xfs_bmap_count_tree(
int numrecs;
error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp, XFS_BMAP_BTREE_REF,
- xfs_bmbt_read_verify);
+ &xfs_bmbt_buf_ops);
if (error)
return error;
*count += 1;
@@ -6073,7 +6073,7 @@ xfs_bmap_count_tree(
while (nextbno != NULLFSBLOCK) {
error = xfs_btree_read_bufl(mp, tp, nextbno, 0, &nbp,
XFS_BMAP_BTREE_REF,
- xfs_bmbt_read_verify);
+ &xfs_bmbt_buf_ops);
if (error)
return error;
*count += 1;
@@ -6105,7 +6105,7 @@ xfs_bmap_count_tree(
bno = nextbno;
error = xfs_btree_read_bufl(mp, tp, bno, 0, &bp,
XFS_BMAP_BTREE_REF,
- xfs_bmbt_read_verify);
+ &xfs_bmbt_buf_ops);
if (error)
return error;
*count += 1;