@@ -445,13 +445,13 @@ xrep_agf(
445445
446446struct xrep_agfl {
447447 /* Bitmap of alleged AGFL blocks that we're not going to add. */
448- struct xbitmap crossed ;
448+ struct xagb_bitmap crossed ;
449449
450450 /* Bitmap of other OWN_AG metadata blocks. */
451- struct xbitmap agmetablocks ;
451+ struct xagb_bitmap agmetablocks ;
452452
453453 /* Bitmap of free space. */
454- struct xbitmap * freesp ;
454+ struct xagb_bitmap * freesp ;
455455
456456 /* rmapbt cursor for finding crosslinked blocks */
457457 struct xfs_btree_cur * rmap_cur ;
@@ -467,22 +467,20 @@ xrep_agfl_walk_rmap(
467467 void * priv )
468468{
469469 struct xrep_agfl * ra = priv ;
470- xfs_fsblock_t fsb ;
471470 int error = 0 ;
472471
473472 if (xchk_should_terminate (ra -> sc , & error ))
474473 return error ;
475474
476475 /* Record all the OWN_AG blocks. */
477476 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 );
481479 if (error )
482480 return error ;
483481 }
484482
485- return xbitmap_set_btcur_path (& ra -> agmetablocks , cur );
483+ return xagb_bitmap_set_btcur_path (& ra -> agmetablocks , cur );
486484}
487485
488486/* Strike out the blocks that are cross-linked according to the rmapbt. */
@@ -493,12 +491,10 @@ xrep_agfl_check_extent(
493491 void * priv )
494492{
495493 struct xrep_agfl * ra = priv ;
496- xfs_agblock_t agbno = XFS_FSB_TO_AGBNO ( ra -> sc -> mp , start ) ;
494+ xfs_agblock_t agbno = start ;
497495 xfs_agblock_t last_agbno = agbno + len - 1 ;
498496 int error ;
499497
500- ASSERT (XFS_FSB_TO_AGNO (ra -> sc -> mp , start ) == ra -> sc -> sa .pag -> pag_agno );
501-
502498 while (agbno <= last_agbno ) {
503499 bool other_owners ;
504500
@@ -508,7 +504,7 @@ xrep_agfl_check_extent(
508504 return error ;
509505
510506 if (other_owners ) {
511- error = xbitmap_set (& ra -> crossed , agbno , 1 );
507+ error = xagb_bitmap_set (& ra -> crossed , agbno , 1 );
512508 if (error )
513509 return error ;
514510 }
@@ -534,7 +530,7 @@ STATIC int
534530xrep_agfl_collect_blocks (
535531 struct xfs_scrub * sc ,
536532 struct xfs_buf * agf_bp ,
537- struct xbitmap * agfl_extents ,
533+ struct xagb_bitmap * agfl_extents ,
538534 xfs_agblock_t * flcount )
539535{
540536 struct xrep_agfl ra ;
@@ -544,8 +540,8 @@ xrep_agfl_collect_blocks(
544540
545541 ra .sc = sc ;
546542 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 );
549545
550546 /* Find all space used by the free space btrees & rmapbt. */
551547 cur = xfs_rmapbt_init_cursor (mp , sc -> tp , agf_bp , sc -> sa .pag );
@@ -557,15 +553,15 @@ xrep_agfl_collect_blocks(
557553 /* Find all blocks currently being used by the bnobt. */
558554 cur = xfs_allocbt_init_cursor (mp , sc -> tp , agf_bp ,
559555 sc -> sa .pag , XFS_BTNUM_BNO );
560- error = xbitmap_set_btblocks (& ra .agmetablocks , cur );
556+ error = xagb_bitmap_set_btblocks (& ra .agmetablocks , cur );
561557 xfs_btree_del_cursor (cur , error );
562558 if (error )
563559 goto out_bmp ;
564560
565561 /* Find all blocks currently being used by the cntbt. */
566562 cur = xfs_allocbt_init_cursor (mp , sc -> tp , agf_bp ,
567563 sc -> sa .pag , XFS_BTNUM_CNT );
568- error = xbitmap_set_btblocks (& ra .agmetablocks , cur );
564+ error = xagb_bitmap_set_btblocks (& ra .agmetablocks , cur );
569565 xfs_btree_del_cursor (cur , error );
570566 if (error )
571567 goto out_bmp ;
@@ -574,30 +570,30 @@ xrep_agfl_collect_blocks(
574570 * Drop the freesp meta blocks that are in use by btrees.
575571 * The remaining blocks /should/ be AGFL blocks.
576572 */
577- error = xbitmap_disunion (agfl_extents , & ra .agmetablocks );
573+ error = xagb_bitmap_disunion (agfl_extents , & ra .agmetablocks );
578574 if (error )
579575 goto out_bmp ;
580576
581577 /* Strike out the blocks that are cross-linked. */
582578 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 );
584580 xfs_btree_del_cursor (ra .rmap_cur , error );
585581 if (error )
586582 goto out_bmp ;
587- error = xbitmap_disunion (agfl_extents , & ra .crossed );
583+ error = xagb_bitmap_disunion (agfl_extents , & ra .crossed );
588584 if (error )
589585 goto out_bmp ;
590586
591587 /*
592588 * Calculate the new AGFL size. If we found more blocks than fit in
593589 * the AGFL we'll free them later.
594590 */
595- * flcount = min_t (uint64_t , xbitmap_hweight (agfl_extents ),
591+ * flcount = min_t (uint64_t , xagb_bitmap_hweight (agfl_extents ),
596592 xfs_agfl_size (mp ));
597593
598594out_bmp :
599- xbitmap_destroy (& ra .crossed );
600- xbitmap_destroy (& ra .agmetablocks );
595+ xagb_bitmap_destroy (& ra .crossed );
596+ xagb_bitmap_destroy (& ra .agmetablocks );
601597 return error ;
602598}
603599
@@ -627,7 +623,7 @@ xrep_agfl_update_agf(
627623}
628624
629625struct xrep_agfl_fill {
630- struct xbitmap used_extents ;
626+ struct xagb_bitmap used_extents ;
631627 struct xfs_scrub * sc ;
632628 __be32 * agfl_bno ;
633629 xfs_agblock_t flcount ;
@@ -643,17 +639,15 @@ xrep_agfl_fill(
643639{
644640 struct xrep_agfl_fill * af = priv ;
645641 struct xfs_scrub * sc = af -> sc ;
646- xfs_fsblock_t fsbno = start ;
642+ xfs_agblock_t agbno = start ;
647643 int error ;
648644
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 );
651646
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 ++ );
655649
656- error = xbitmap_set (& af -> used_extents , start , fsbno - 1 );
650+ error = xagb_bitmap_set (& af -> used_extents , start , agbno - 1 );
657651 if (error )
658652 return error ;
659653
@@ -668,7 +662,7 @@ STATIC int
668662xrep_agfl_init_header (
669663 struct xfs_scrub * sc ,
670664 struct xfs_buf * agfl_bp ,
671- struct xbitmap * agfl_extents ,
665+ struct xagb_bitmap * agfl_extents ,
672666 xfs_agblock_t flcount )
673667{
674668 struct xrep_agfl_fill af = {
@@ -696,17 +690,17 @@ xrep_agfl_init_header(
696690 * blocks than fit in the AGFL, they will be freed in a subsequent
697691 * step.
698692 */
699- xbitmap_init (& af .used_extents );
693+ xagb_bitmap_init (& af .used_extents );
700694 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 );
703697 if (error )
704698 return error ;
705699
706700 /* Write new AGFL to disk. */
707701 xfs_trans_buf_set_type (sc -> tp , agfl_bp , XFS_BLFT_AGFL_BUF );
708702 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 );
710704 return 0 ;
711705}
712706
715709xrep_agfl (
716710 struct xfs_scrub * sc )
717711{
718- struct xbitmap agfl_extents ;
712+ struct xagb_bitmap agfl_extents ;
719713 struct xfs_mount * mp = sc -> mp ;
720714 struct xfs_buf * agf_bp ;
721715 struct xfs_buf * agfl_bp ;
@@ -726,7 +720,7 @@ xrep_agfl(
726720 if (!xfs_has_rmapbt (mp ))
727721 return - EOPNOTSUPP ;
728722
729- xbitmap_init (& agfl_extents );
723+ xagb_bitmap_init (& agfl_extents );
730724
731725 /*
732726 * Read the AGF so that we can query the rmapbt. We hope that there's
@@ -775,10 +769,10 @@ xrep_agfl(
775769 goto err ;
776770
777771 /* 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 ,
779773 XFS_AG_RESV_AGFL );
780774err :
781- xbitmap_destroy (& agfl_extents );
775+ xagb_bitmap_destroy (& agfl_extents );
782776 return error ;
783777}
784778
0 commit comments