aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_readdir.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2014-06-06 01:14:11 -0400
committerDave Chinner <david@fromorbit.com>2014-06-06 01:14:11 -0400
commitd6cf13051f31bf1a54b65643d0e578b3ca2f0692 (patch)
tree135c8bfa288892dde3979bdf0ae3ef03d2627300 /fs/xfs/xfs_dir2_readdir.c
parent7dda6e8644a31c366484bbcb564ea6c6225e5963 (diff)
xfs: convert m_dirblkfsbs to xfs_da_geometry
Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_readdir.c')
-rw-r--r--fs/xfs/xfs_dir2_readdir.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c
index 0c8c09cf313f..8cb5340071e8 100644
--- a/fs/xfs/xfs_dir2_readdir.c
+++ b/fs/xfs/xfs_dir2_readdir.c
@@ -314,12 +314,12 @@ xfs_dir2_leaf_readbuf(
314 if (bp) { 314 if (bp) {
315 xfs_trans_brelse(NULL, bp); 315 xfs_trans_brelse(NULL, bp);
316 bp = NULL; 316 bp = NULL;
317 mip->map_blocks -= mp->m_dirblkfsbs; 317 mip->map_blocks -= geo->fsbcount;
318 /* 318 /*
319 * Loop to get rid of the extents for the 319 * Loop to get rid of the extents for the
320 * directory block. 320 * directory block.
321 */ 321 */
322 for (i = mp->m_dirblkfsbs; i > 0; ) { 322 for (i = geo->fsbcount; i > 0; ) {
323 j = min_t(int, map->br_blockcount, i); 323 j = min_t(int, map->br_blockcount, i);
324 map->br_blockcount -= j; 324 map->br_blockcount -= j;
325 map->br_startblock += j; 325 map->br_startblock += j;
@@ -410,7 +410,7 @@ xfs_dir2_leaf_readbuf(
410 */ 410 */
411 mip->curdb = xfs_dir2_da_to_db(geo, map->br_startoff); 411 mip->curdb = xfs_dir2_da_to_db(geo, map->br_startoff);
412 error = xfs_dir3_data_read(NULL, dp, map->br_startoff, 412 error = xfs_dir3_data_read(NULL, dp, map->br_startoff,
413 map->br_blockcount >= mp->m_dirblkfsbs ? 413 map->br_blockcount >= geo->fsbcount ?
414 XFS_FSB_TO_DADDR(mp, map->br_startblock) : -1, &bp); 414 XFS_FSB_TO_DADDR(mp, map->br_startblock) : -1, &bp);
415 415
416 /* 416 /*
@@ -424,7 +424,7 @@ xfs_dir2_leaf_readbuf(
424 * was previously ra. 424 * was previously ra.
425 */ 425 */
426 if (mip->ra_current) 426 if (mip->ra_current)
427 mip->ra_current -= mp->m_dirblkfsbs; 427 mip->ra_current -= geo->fsbcount;
428 428
429 /* 429 /*
430 * Do we need more readahead? 430 * Do we need more readahead?
@@ -432,13 +432,13 @@ xfs_dir2_leaf_readbuf(
432 blk_start_plug(&plug); 432 blk_start_plug(&plug);
433 for (mip->ra_index = mip->ra_offset = i = 0; 433 for (mip->ra_index = mip->ra_offset = i = 0;
434 mip->ra_want > mip->ra_current && i < mip->map_blocks; 434 mip->ra_want > mip->ra_current && i < mip->map_blocks;
435 i += mp->m_dirblkfsbs) { 435 i += geo->fsbcount) {
436 ASSERT(mip->ra_index < mip->map_valid); 436 ASSERT(mip->ra_index < mip->map_valid);
437 /* 437 /*
438 * Read-ahead a contiguous directory block. 438 * Read-ahead a contiguous directory block.
439 */ 439 */
440 if (i > mip->ra_current && 440 if (i > mip->ra_current &&
441 map[mip->ra_index].br_blockcount >= mp->m_dirblkfsbs) { 441 map[mip->ra_index].br_blockcount >= geo->fsbcount) {
442 xfs_dir3_data_readahead(dp, 442 xfs_dir3_data_readahead(dp,
443 map[mip->ra_index].br_startoff + mip->ra_offset, 443 map[mip->ra_index].br_startoff + mip->ra_offset,
444 XFS_FSB_TO_DADDR(mp, 444 XFS_FSB_TO_DADDR(mp,
@@ -461,12 +461,12 @@ xfs_dir2_leaf_readbuf(
461 /* 461 /*
462 * Advance offset through the mapping table. 462 * Advance offset through the mapping table.
463 */ 463 */
464 for (j = 0; j < mp->m_dirblkfsbs; j += length ) { 464 for (j = 0; j < geo->fsbcount; j += length ) {
465 /* 465 /*
466 * The rest of this extent but not more than a dir 466 * The rest of this extent but not more than a dir
467 * block. 467 * block.
468 */ 468 */
469 length = min_t(int, mp->m_dirblkfsbs, 469 length = min_t(int, geo->fsbcount,
470 map[mip->ra_index].br_blockcount - 470 map[mip->ra_index].br_blockcount -
471 mip->ra_offset); 471 mip->ra_offset);
472 mip->ra_offset += length; 472 mip->ra_offset += length;