aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_block.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-11-12 06:54:10 -0500
committerBen Myers <bpm@sgi.com>2012-11-15 22:34:36 -0500
commit4bb20a83a2a5ac4dcb62780c9950e47939956126 (patch)
tree2eef49464d5d58a54ab0bd0299e5054e8b657ce6 /fs/xfs/xfs_dir2_block.c
parentc6319198702350a2215a8c0cacd6cc4283728a1b (diff)
xfs: add verifier callback to directory read code
Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Phil White <pwhite@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_block.c')
-rw-r--r--fs/xfs/xfs_dir2_block.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c
index e93ca8f054f4..53666ca6c953 100644
--- a/fs/xfs/xfs_dir2_block.c
+++ b/fs/xfs/xfs_dir2_block.c
@@ -97,10 +97,10 @@ xfs_dir2_block_addname(
97 /* 97 /*
98 * Read the (one and only) directory block into dabuf bp. 98 * Read the (one and only) directory block into dabuf bp.
99 */ 99 */
100 if ((error = 100 error = xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, &bp,
101 xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, &bp, XFS_DATA_FORK))) { 101 XFS_DATA_FORK, NULL);
102 if (error)
102 return error; 103 return error;
103 }
104 ASSERT(bp != NULL); 104 ASSERT(bp != NULL);
105 hdr = bp->b_addr; 105 hdr = bp->b_addr;
106 /* 106 /*
@@ -457,7 +457,7 @@ xfs_dir2_block_getdents(
457 * Can't read the block, give up, else get dabuf in bp. 457 * Can't read the block, give up, else get dabuf in bp.
458 */ 458 */
459 error = xfs_da_read_buf(NULL, dp, mp->m_dirdatablk, -1, 459 error = xfs_da_read_buf(NULL, dp, mp->m_dirdatablk, -1,
460 &bp, XFS_DATA_FORK); 460 &bp, XFS_DATA_FORK, NULL);
461 if (error) 461 if (error)
462 return error; 462 return error;
463 463
@@ -640,10 +640,10 @@ xfs_dir2_block_lookup_int(
640 /* 640 /*
641 * Read the buffer, return error if we can't get it. 641 * Read the buffer, return error if we can't get it.
642 */ 642 */
643 if ((error = 643 error = xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, &bp,
644 xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, &bp, XFS_DATA_FORK))) { 644 XFS_DATA_FORK, NULL);
645 if (error)
645 return error; 646 return error;
646 }
647 ASSERT(bp != NULL); 647 ASSERT(bp != NULL);
648 hdr = bp->b_addr; 648 hdr = bp->b_addr;
649 xfs_dir2_data_check(dp, bp); 649 xfs_dir2_data_check(dp, bp);
@@ -917,10 +917,11 @@ xfs_dir2_leaf_to_block(
917 /* 917 /*
918 * Read the data block if we don't already have it, give up if it fails. 918 * Read the data block if we don't already have it, give up if it fails.
919 */ 919 */
920 if (dbp == NULL && 920 if (!dbp) {
921 (error = xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, &dbp, 921 error = xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, &dbp,
922 XFS_DATA_FORK))) { 922 XFS_DATA_FORK, NULL);
923 return error; 923 if (error)
924 return error;
924 } 925 }
925 hdr = dbp->b_addr; 926 hdr = dbp->b_addr;
926 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC)); 927 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC));