aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_dir2.c')
-rw-r--r--fs/xfs/xfs_dir2.c50
1 files changed, 23 insertions, 27 deletions
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c
index 97f1802a9018..07aa3907d237 100644
--- a/fs/xfs/xfs_dir2.c
+++ b/fs/xfs/xfs_dir2.c
@@ -282,7 +282,7 @@ xfs_dir_createname(
282 goto out_free; 282 goto out_free;
283 } 283 }
284 284
285 rval = xfs_dir2_isblock(dp, &v); 285 rval = xfs_dir2_isblock(args, &v);
286 if (rval) 286 if (rval)
287 goto out_free; 287 goto out_free;
288 if (v) { 288 if (v) {
@@ -290,7 +290,7 @@ xfs_dir_createname(
290 goto out_free; 290 goto out_free;
291 } 291 }
292 292
293 rval = xfs_dir2_isleaf(dp, &v); 293 rval = xfs_dir2_isleaf(args, &v);
294 if (rval) 294 if (rval)
295 goto out_free; 295 goto out_free;
296 if (v) 296 if (v)
@@ -375,7 +375,7 @@ xfs_dir_lookup(
375 goto out_check_rval; 375 goto out_check_rval;
376 } 376 }
377 377
378 rval = xfs_dir2_isblock(dp, &v); 378 rval = xfs_dir2_isblock(args, &v);
379 if (rval) 379 if (rval)
380 goto out_free; 380 goto out_free;
381 if (v) { 381 if (v) {
@@ -383,7 +383,7 @@ xfs_dir_lookup(
383 goto out_check_rval; 383 goto out_check_rval;
384 } 384 }
385 385
386 rval = xfs_dir2_isleaf(dp, &v); 386 rval = xfs_dir2_isleaf(args, &v);
387 if (rval) 387 if (rval)
388 goto out_free; 388 goto out_free;
389 if (v) 389 if (v)
@@ -448,7 +448,7 @@ xfs_dir_removename(
448 goto out_free; 448 goto out_free;
449 } 449 }
450 450
451 rval = xfs_dir2_isblock(dp, &v); 451 rval = xfs_dir2_isblock(args, &v);
452 if (rval) 452 if (rval)
453 goto out_free; 453 goto out_free;
454 if (v) { 454 if (v) {
@@ -456,7 +456,7 @@ xfs_dir_removename(
456 goto out_free; 456 goto out_free;
457 } 457 }
458 458
459 rval = xfs_dir2_isleaf(dp, &v); 459 rval = xfs_dir2_isleaf(args, &v);
460 if (rval) 460 if (rval)
461 goto out_free; 461 goto out_free;
462 if (v) 462 if (v)
@@ -513,7 +513,7 @@ xfs_dir_replace(
513 goto out_free; 513 goto out_free;
514 } 514 }
515 515
516 rval = xfs_dir2_isblock(dp, &v); 516 rval = xfs_dir2_isblock(args, &v);
517 if (rval) 517 if (rval)
518 goto out_free; 518 goto out_free;
519 if (v) { 519 if (v) {
@@ -521,7 +521,7 @@ xfs_dir_replace(
521 goto out_free; 521 goto out_free;
522 } 522 }
523 523
524 rval = xfs_dir2_isleaf(dp, &v); 524 rval = xfs_dir2_isleaf(args, &v);
525 if (rval) 525 if (rval)
526 goto out_free; 526 goto out_free;
527 if (v) 527 if (v)
@@ -573,7 +573,7 @@ xfs_dir_canenter(
573 goto out_free; 573 goto out_free;
574 } 574 }
575 575
576 rval = xfs_dir2_isblock(dp, &v); 576 rval = xfs_dir2_isblock(args, &v);
577 if (rval) 577 if (rval)
578 goto out_free; 578 goto out_free;
579 if (v) { 579 if (v) {
@@ -581,7 +581,7 @@ xfs_dir_canenter(
581 goto out_free; 581 goto out_free;
582 } 582 }
583 583
584 rval = xfs_dir2_isleaf(dp, &v); 584 rval = xfs_dir2_isleaf(args, &v);
585 if (rval) 585 if (rval)
586 goto out_free; 586 goto out_free;
587 if (v) 587 if (v)
@@ -649,18 +649,16 @@ xfs_dir2_grow_inode(
649 */ 649 */
650int 650int
651xfs_dir2_isblock( 651xfs_dir2_isblock(
652 xfs_inode_t *dp, 652 struct xfs_da_args *args,
653 int *vp) /* out: 1 is block, 0 is not block */ 653 int *vp) /* out: 1 is block, 0 is not block */
654{ 654{
655 xfs_fileoff_t last; /* last file offset */ 655 xfs_fileoff_t last; /* last file offset */
656 xfs_mount_t *mp; 656 int rval;
657 int rval;
658 657
659 mp = dp->i_mount; 658 if ((rval = xfs_bmap_last_offset(args->dp, &last, XFS_DATA_FORK)))
660 if ((rval = xfs_bmap_last_offset(dp, &last, XFS_DATA_FORK)))
661 return rval; 659 return rval;
662 rval = XFS_FSB_TO_B(mp, last) == mp->m_dir_geo->blksize; 660 rval = XFS_FSB_TO_B(args->dp->i_mount, last) == args->geo->blksize;
663 ASSERT(rval == 0 || dp->i_d.di_size == mp->m_dir_geo->blksize); 661 ASSERT(rval == 0 || args->dp->i_d.di_size == args->geo->blksize);
664 *vp = rval; 662 *vp = rval;
665 return 0; 663 return 0;
666} 664}
@@ -670,17 +668,15 @@ xfs_dir2_isblock(
670 */ 668 */
671int 669int
672xfs_dir2_isleaf( 670xfs_dir2_isleaf(
673 xfs_inode_t *dp, 671 struct xfs_da_args *args,
674 int *vp) /* out: 1 is leaf, 0 is not leaf */ 672 int *vp) /* out: 1 is block, 0 is not block */
675{ 673{
676 xfs_fileoff_t last; /* last file offset */ 674 xfs_fileoff_t last; /* last file offset */
677 xfs_mount_t *mp; 675 int rval;
678 int rval;
679 676
680 mp = dp->i_mount; 677 if ((rval = xfs_bmap_last_offset(args->dp, &last, XFS_DATA_FORK)))
681 if ((rval = xfs_bmap_last_offset(dp, &last, XFS_DATA_FORK)))
682 return rval; 678 return rval;
683 *vp = last == mp->m_dir_geo->leafblk + (1 << mp->m_sb.sb_dirblklog); 679 *vp = last == args->geo->leafblk + args->geo->fsbcount;
684 return 0; 680 return 0;
685} 681}
686 682