aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index dfcbe73f1db4..66282dcb821b 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -420,23 +420,27 @@ xfs_inode_buf_verify(
420 xfs_inobp_check(mp, bp); 420 xfs_inobp_check(mp, bp);
421} 421}
422 422
423void 423
424xfs_inode_buf_write_verify( 424static void
425xfs_inode_buf_read_verify(
425 struct xfs_buf *bp) 426 struct xfs_buf *bp)
426{ 427{
427 xfs_inode_buf_verify(bp); 428 xfs_inode_buf_verify(bp);
428} 429}
429 430
430void 431static void
431xfs_inode_buf_read_verify( 432xfs_inode_buf_write_verify(
432 struct xfs_buf *bp) 433 struct xfs_buf *bp)
433{ 434{
434 xfs_inode_buf_verify(bp); 435 xfs_inode_buf_verify(bp);
435 bp->b_pre_io = xfs_inode_buf_write_verify;
436 bp->b_iodone = NULL;
437 xfs_buf_ioend(bp, 0);
438} 436}
439 437
438const struct xfs_buf_ops xfs_inode_buf_ops = {
439 .verify_read = xfs_inode_buf_read_verify,
440 .verify_write = xfs_inode_buf_write_verify,
441};
442
443
440/* 444/*
441 * This routine is called to map an inode to the buffer containing the on-disk 445 * This routine is called to map an inode to the buffer containing the on-disk
442 * version of the inode. It returns a pointer to the buffer containing the 446 * version of the inode. It returns a pointer to the buffer containing the
@@ -462,7 +466,7 @@ xfs_imap_to_bp(
462 buf_flags |= XBF_UNMAPPED; 466 buf_flags |= XBF_UNMAPPED;
463 error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, imap->im_blkno, 467 error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, imap->im_blkno,
464 (int)imap->im_len, buf_flags, &bp, 468 (int)imap->im_len, buf_flags, &bp,
465 xfs_inode_buf_read_verify); 469 &xfs_inode_buf_ops);
466 if (error) { 470 if (error) {
467 if (error == EAGAIN) { 471 if (error == EAGAIN) {
468 ASSERT(buf_flags & XBF_TRYLOCK); 472 ASSERT(buf_flags & XBF_TRYLOCK);
@@ -1792,7 +1796,7 @@ xfs_ifree_cluster(
1792 * want it to fail. We can acheive this by adding a write 1796 * want it to fail. We can acheive this by adding a write
1793 * verifier to the buffer. 1797 * verifier to the buffer.
1794 */ 1798 */
1795 bp->b_pre_io = xfs_inode_buf_write_verify; 1799 bp->b_ops = &xfs_inode_buf_ops;
1796 1800
1797 /* 1801 /*
1798 * Walk the inodes already attached to the buffer and mark them 1802 * Walk the inodes already attached to the buffer and mark them