@@ -445,13 +445,13 @@ xrep_agf(
445
445
446
446
struct xrep_agfl {
447
447
/* Bitmap of alleged AGFL blocks that we're not going to add. */
448
- struct xbitmap crossed ;
448
+ struct xagb_bitmap crossed ;
449
449
450
450
/* Bitmap of other OWN_AG metadata blocks. */
451
- struct xbitmap agmetablocks ;
451
+ struct xagb_bitmap agmetablocks ;
452
452
453
453
/* Bitmap of free space. */
454
- struct xbitmap * freesp ;
454
+ struct xagb_bitmap * freesp ;
455
455
456
456
/* rmapbt cursor for finding crosslinked blocks */
457
457
struct xfs_btree_cur * rmap_cur ;
@@ -467,22 +467,20 @@ xrep_agfl_walk_rmap(
467
467
void * priv )
468
468
{
469
469
struct xrep_agfl * ra = priv ;
470
- xfs_fsblock_t fsb ;
471
470
int error = 0 ;
472
471
473
472
if (xchk_should_terminate (ra -> sc , & error ))
474
473
return error ;
475
474
476
475
/* Record all the OWN_AG blocks. */
477
476
if (rec -> rm_owner == XFS_RMAP_OWN_AG ) {
478
- fsb = XFS_AGB_TO_FSB (cur -> bc_mp , cur -> bc_ag .pag -> pag_agno ,
479
- rec -> rm_startblock );
480
- error = xbitmap_set (ra -> freesp , fsb , rec -> rm_blockcount );
477
+ error = xagb_bitmap_set (ra -> freesp , rec -> rm_startblock ,
478
+ rec -> rm_blockcount );
481
479
if (error )
482
480
return error ;
483
481
}
484
482
485
- return xbitmap_set_btcur_path (& ra -> agmetablocks , cur );
483
+ return xagb_bitmap_set_btcur_path (& ra -> agmetablocks , cur );
486
484
}
487
485
488
486
/* Strike out the blocks that are cross-linked according to the rmapbt. */
@@ -493,12 +491,10 @@ xrep_agfl_check_extent(
493
491
void * priv )
494
492
{
495
493
struct xrep_agfl * ra = priv ;
496
- xfs_agblock_t agbno = XFS_FSB_TO_AGBNO ( ra -> sc -> mp , start ) ;
494
+ xfs_agblock_t agbno = start ;
497
495
xfs_agblock_t last_agbno = agbno + len - 1 ;
498
496
int error ;
499
497
500
- ASSERT (XFS_FSB_TO_AGNO (ra -> sc -> mp , start ) == ra -> sc -> sa .pag -> pag_agno );
501
-
502
498
while (agbno <= last_agbno ) {
503
499
bool other_owners ;
504
500
@@ -508,7 +504,7 @@ xrep_agfl_check_extent(
508
504
return error ;
509
505
510
506
if (other_owners ) {
511
- error = xbitmap_set (& ra -> crossed , agbno , 1 );
507
+ error = xagb_bitmap_set (& ra -> crossed , agbno , 1 );
512
508
if (error )
513
509
return error ;
514
510
}
@@ -534,7 +530,7 @@ STATIC int
534
530
xrep_agfl_collect_blocks (
535
531
struct xfs_scrub * sc ,
536
532
struct xfs_buf * agf_bp ,
537
- struct xbitmap * agfl_extents ,
533
+ struct xagb_bitmap * agfl_extents ,
538
534
xfs_agblock_t * flcount )
539
535
{
540
536
struct xrep_agfl ra ;
@@ -544,8 +540,8 @@ xrep_agfl_collect_blocks(
544
540
545
541
ra .sc = sc ;
546
542
ra .freesp = agfl_extents ;
547
- xbitmap_init (& ra .agmetablocks );
548
- xbitmap_init (& ra .crossed );
543
+ xagb_bitmap_init (& ra .agmetablocks );
544
+ xagb_bitmap_init (& ra .crossed );
549
545
550
546
/* Find all space used by the free space btrees & rmapbt. */
551
547
cur = xfs_rmapbt_init_cursor (mp , sc -> tp , agf_bp , sc -> sa .pag );
@@ -557,15 +553,15 @@ xrep_agfl_collect_blocks(
557
553
/* Find all blocks currently being used by the bnobt. */
558
554
cur = xfs_allocbt_init_cursor (mp , sc -> tp , agf_bp ,
559
555
sc -> sa .pag , XFS_BTNUM_BNO );
560
- error = xbitmap_set_btblocks (& ra .agmetablocks , cur );
556
+ error = xagb_bitmap_set_btblocks (& ra .agmetablocks , cur );
561
557
xfs_btree_del_cursor (cur , error );
562
558
if (error )
563
559
goto out_bmp ;
564
560
565
561
/* Find all blocks currently being used by the cntbt. */
566
562
cur = xfs_allocbt_init_cursor (mp , sc -> tp , agf_bp ,
567
563
sc -> sa .pag , XFS_BTNUM_CNT );
568
- error = xbitmap_set_btblocks (& ra .agmetablocks , cur );
564
+ error = xagb_bitmap_set_btblocks (& ra .agmetablocks , cur );
569
565
xfs_btree_del_cursor (cur , error );
570
566
if (error )
571
567
goto out_bmp ;
@@ -574,30 +570,30 @@ xrep_agfl_collect_blocks(
574
570
* Drop the freesp meta blocks that are in use by btrees.
575
571
* The remaining blocks /should/ be AGFL blocks.
576
572
*/
577
- error = xbitmap_disunion (agfl_extents , & ra .agmetablocks );
573
+ error = xagb_bitmap_disunion (agfl_extents , & ra .agmetablocks );
578
574
if (error )
579
575
goto out_bmp ;
580
576
581
577
/* Strike out the blocks that are cross-linked. */
582
578
ra .rmap_cur = xfs_rmapbt_init_cursor (mp , sc -> tp , agf_bp , sc -> sa .pag );
583
- error = xbitmap_walk (agfl_extents , xrep_agfl_check_extent , & ra );
579
+ error = xagb_bitmap_walk (agfl_extents , xrep_agfl_check_extent , & ra );
584
580
xfs_btree_del_cursor (ra .rmap_cur , error );
585
581
if (error )
586
582
goto out_bmp ;
587
- error = xbitmap_disunion (agfl_extents , & ra .crossed );
583
+ error = xagb_bitmap_disunion (agfl_extents , & ra .crossed );
588
584
if (error )
589
585
goto out_bmp ;
590
586
591
587
/*
592
588
* Calculate the new AGFL size. If we found more blocks than fit in
593
589
* the AGFL we'll free them later.
594
590
*/
595
- * flcount = min_t (uint64_t , xbitmap_hweight (agfl_extents ),
591
+ * flcount = min_t (uint64_t , xagb_bitmap_hweight (agfl_extents ),
596
592
xfs_agfl_size (mp ));
597
593
598
594
out_bmp :
599
- xbitmap_destroy (& ra .crossed );
600
- xbitmap_destroy (& ra .agmetablocks );
595
+ xagb_bitmap_destroy (& ra .crossed );
596
+ xagb_bitmap_destroy (& ra .agmetablocks );
601
597
return error ;
602
598
}
603
599
@@ -627,7 +623,7 @@ xrep_agfl_update_agf(
627
623
}
628
624
629
625
struct xrep_agfl_fill {
630
- struct xbitmap used_extents ;
626
+ struct xagb_bitmap used_extents ;
631
627
struct xfs_scrub * sc ;
632
628
__be32 * agfl_bno ;
633
629
xfs_agblock_t flcount ;
@@ -643,17 +639,15 @@ xrep_agfl_fill(
643
639
{
644
640
struct xrep_agfl_fill * af = priv ;
645
641
struct xfs_scrub * sc = af -> sc ;
646
- xfs_fsblock_t fsbno = start ;
642
+ xfs_agblock_t agbno = start ;
647
643
int error ;
648
644
649
- trace_xrep_agfl_insert (sc -> sa .pag , XFS_FSB_TO_AGBNO (sc -> mp , start ),
650
- len );
645
+ trace_xrep_agfl_insert (sc -> sa .pag , agbno , len );
651
646
652
- while (fsbno < start + len && af -> fl_off < af -> flcount )
653
- af -> agfl_bno [af -> fl_off ++ ] =
654
- cpu_to_be32 (XFS_FSB_TO_AGBNO (sc -> mp , fsbno ++ ));
647
+ while (agbno < start + len && af -> fl_off < af -> flcount )
648
+ af -> agfl_bno [af -> fl_off ++ ] = cpu_to_be32 (agbno ++ );
655
649
656
- error = xbitmap_set (& af -> used_extents , start , fsbno - 1 );
650
+ error = xagb_bitmap_set (& af -> used_extents , start , agbno - 1 );
657
651
if (error )
658
652
return error ;
659
653
@@ -668,7 +662,7 @@ STATIC int
668
662
xrep_agfl_init_header (
669
663
struct xfs_scrub * sc ,
670
664
struct xfs_buf * agfl_bp ,
671
- struct xbitmap * agfl_extents ,
665
+ struct xagb_bitmap * agfl_extents ,
672
666
xfs_agblock_t flcount )
673
667
{
674
668
struct xrep_agfl_fill af = {
@@ -696,17 +690,17 @@ xrep_agfl_init_header(
696
690
* blocks than fit in the AGFL, they will be freed in a subsequent
697
691
* step.
698
692
*/
699
- xbitmap_init (& af .used_extents );
693
+ xagb_bitmap_init (& af .used_extents );
700
694
af .agfl_bno = xfs_buf_to_agfl_bno (agfl_bp ),
701
- xbitmap_walk (agfl_extents , xrep_agfl_fill , & af );
702
- error = xbitmap_disunion (agfl_extents , & af .used_extents );
695
+ xagb_bitmap_walk (agfl_extents , xrep_agfl_fill , & af );
696
+ error = xagb_bitmap_disunion (agfl_extents , & af .used_extents );
703
697
if (error )
704
698
return error ;
705
699
706
700
/* Write new AGFL to disk. */
707
701
xfs_trans_buf_set_type (sc -> tp , agfl_bp , XFS_BLFT_AGFL_BUF );
708
702
xfs_trans_log_buf (sc -> tp , agfl_bp , 0 , BBTOB (agfl_bp -> b_length ) - 1 );
709
- xbitmap_destroy (& af .used_extents );
703
+ xagb_bitmap_destroy (& af .used_extents );
710
704
return 0 ;
711
705
}
712
706
715
709
xrep_agfl (
716
710
struct xfs_scrub * sc )
717
711
{
718
- struct xbitmap agfl_extents ;
712
+ struct xagb_bitmap agfl_extents ;
719
713
struct xfs_mount * mp = sc -> mp ;
720
714
struct xfs_buf * agf_bp ;
721
715
struct xfs_buf * agfl_bp ;
@@ -726,7 +720,7 @@ xrep_agfl(
726
720
if (!xfs_has_rmapbt (mp ))
727
721
return - EOPNOTSUPP ;
728
722
729
- xbitmap_init (& agfl_extents );
723
+ xagb_bitmap_init (& agfl_extents );
730
724
731
725
/*
732
726
* Read the AGF so that we can query the rmapbt. We hope that there's
@@ -775,10 +769,10 @@ xrep_agfl(
775
769
goto err ;
776
770
777
771
/* Dump any AGFL overflow. */
778
- error = xrep_reap_ag_metadata (sc , & agfl_extents , & XFS_RMAP_OINFO_AG ,
772
+ error = xrep_reap_agblocks (sc , & agfl_extents , & XFS_RMAP_OINFO_AG ,
779
773
XFS_AG_RESV_AGFL );
780
774
err :
781
- xbitmap_destroy (& agfl_extents );
775
+ xagb_bitmap_destroy (& agfl_extents );
782
776
return error ;
783
777
}
784
778
0 commit comments