aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_data.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_dir2_data.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_dir2_data.c')
-rw-r--r--fs/xfs/xfs_dir2_data.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/fs/xfs/xfs_dir2_data.c b/fs/xfs/xfs_dir2_data.c
index 1a43c8593c00..b555585f5ab6 100644
--- a/fs/xfs/xfs_dir2_data.c
+++ b/fs/xfs/xfs_dir2_data.c
@@ -200,11 +200,26 @@ xfs_dir2_data_verify(
200 XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, hdr); 200 XFS_CORRUPTION_ERROR(__func__, XFS_ERRLEVEL_LOW, mp, hdr);
201 xfs_buf_ioerror(bp, EFSCORRUPTED); 201 xfs_buf_ioerror(bp, EFSCORRUPTED);
202 } 202 }
203}
204
205static void
206xfs_dir2_data_write_verify(
207 struct xfs_buf *bp)
208{
209 xfs_dir2_data_verify(bp);
210}
203 211
212void
213xfs_dir2_data_read_verify(
214 struct xfs_buf *bp)
215{
216 xfs_dir2_data_verify(bp);
217 bp->b_pre_io = xfs_dir2_data_write_verify;
204 bp->b_iodone = NULL; 218 bp->b_iodone = NULL;
205 xfs_buf_ioend(bp, 0); 219 xfs_buf_ioend(bp, 0);
206} 220}
207 221
222
208int 223int
209xfs_dir2_data_read( 224xfs_dir2_data_read(
210 struct xfs_trans *tp, 225 struct xfs_trans *tp,
@@ -214,7 +229,7 @@ xfs_dir2_data_read(
214 struct xfs_buf **bpp) 229 struct xfs_buf **bpp)
215{ 230{
216 return xfs_da_read_buf(tp, dp, bno, mapped_bno, bpp, 231 return xfs_da_read_buf(tp, dp, bno, mapped_bno, bpp,
217 XFS_DATA_FORK, xfs_dir2_data_verify); 232 XFS_DATA_FORK, xfs_dir2_data_read_verify);
218} 233}
219 234
220int 235int
@@ -225,7 +240,7 @@ xfs_dir2_data_readahead(
225 xfs_daddr_t mapped_bno) 240 xfs_daddr_t mapped_bno)
226{ 241{
227 return xfs_da_reada_buf(tp, dp, bno, mapped_bno, 242 return xfs_da_reada_buf(tp, dp, bno, mapped_bno,
228 XFS_DATA_FORK, xfs_dir2_data_verify); 243 XFS_DATA_FORK, xfs_dir2_data_read_verify);
229} 244}
230 245
231/* 246/*