Skip to content

Commit 4ad85e6

Browse files
Nirjhar-Roy-0211cmaiolino
authored andcommitted
xfs: Replace &rtg->rtg_group with rtg_group()
Use the already existing rtg_group() wrapper instead of directly accessing the struct xfs_group member in struct xfs_rtgroup. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com> [cem: Conflict resolution against 06873db] Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent a49b7ff commit 4ad85e6

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

fs/xfs/xfs_zone_alloc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ xfs_zone_account_reclaimable(
7878
struct xfs_rtgroup *rtg,
7979
uint32_t freed)
8080
{
81-
struct xfs_group *xg = &rtg->rtg_group;
81+
struct xfs_group *xg = rtg_group(rtg);
8282
struct xfs_mount *mp = rtg_mount(rtg);
8383
struct xfs_zone_info *zi = mp->m_zone_info;
8484
uint32_t used = rtg_rmap(rtg)->i_used_blocks;
@@ -759,7 +759,7 @@ xfs_zone_alloc_blocks(
759759

760760
trace_xfs_zone_alloc_blocks(oz, allocated, count_fsb);
761761

762-
*sector = xfs_gbno_to_daddr(&rtg->rtg_group, 0);
762+
*sector = xfs_gbno_to_daddr(rtg_group(rtg), 0);
763763
*is_seq = bdev_zone_is_seq(mp->m_rtdev_targp->bt_bdev, *sector);
764764
if (!*is_seq)
765765
*sector += XFS_FSB_TO_BB(mp, allocated);
@@ -1080,7 +1080,7 @@ xfs_init_zone(
10801080
if (write_pointer == 0) {
10811081
/* zone is empty */
10821082
atomic_inc(&zi->zi_nr_free_zones);
1083-
xfs_group_set_mark(&rtg->rtg_group, XFS_RTG_FREE);
1083+
xfs_group_set_mark(rtg_group(rtg), XFS_RTG_FREE);
10841084
iz->available += rtg_blocks(rtg);
10851085
} else if (write_pointer < rtg_blocks(rtg)) {
10861086
/* zone is open */

fs/xfs/xfs_zone_gc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ xfs_zone_gc_alloc_blocks(
627627
if (!*count_fsb)
628628
return NULL;
629629

630-
*daddr = xfs_gbno_to_daddr(&oz->oz_rtg->rtg_group, 0);
630+
*daddr = xfs_gbno_to_daddr(rtg_group(oz->oz_rtg), 0);
631631
*is_seq = bdev_zone_is_seq(mp->m_rtdev_targp->bt_bdev, *daddr);
632632
if (!*is_seq)
633633
*daddr += XFS_FSB_TO_BB(mp, oz->oz_allocated);
@@ -702,7 +702,7 @@ xfs_zone_gc_start_chunk(
702702
chunk->data = data;
703703
chunk->oz = oz;
704704
chunk->victim_rtg = iter->victim_rtg;
705-
atomic_inc(&chunk->victim_rtg->rtg_group.xg_active_ref);
705+
atomic_inc(&rtg_group(chunk->victim_rtg)->xg_active_ref);
706706
atomic_inc(&chunk->victim_rtg->rtg_gccount);
707707

708708
bio->bi_iter.bi_sector = xfs_rtb_to_daddr(mp, chunk->old_startblock);
@@ -788,7 +788,7 @@ xfs_zone_gc_split_write(
788788
atomic_inc(&chunk->oz->oz_ref);
789789

790790
split_chunk->victim_rtg = chunk->victim_rtg;
791-
atomic_inc(&chunk->victim_rtg->rtg_group.xg_active_ref);
791+
atomic_inc(&rtg_group(chunk->victim_rtg)->xg_active_ref);
792792
atomic_inc(&chunk->victim_rtg->rtg_gccount);
793793

794794
chunk->offset += split_len;
@@ -888,7 +888,7 @@ xfs_zone_gc_finish_reset(
888888
goto out;
889889
}
890890

891-
xfs_group_set_mark(&rtg->rtg_group, XFS_RTG_FREE);
891+
xfs_group_set_mark(rtg_group(rtg), XFS_RTG_FREE);
892892
atomic_inc(&zi->zi_nr_free_zones);
893893

894894
xfs_zoned_add_available(mp, rtg_blocks(rtg));
@@ -917,7 +917,7 @@ xfs_submit_zone_reset_bio(
917917

918918
XFS_STATS_INC(mp, xs_gc_zone_reset_calls);
919919

920-
bio->bi_iter.bi_sector = xfs_gbno_to_daddr(&rtg->rtg_group, 0);
920+
bio->bi_iter.bi_sector = xfs_gbno_to_daddr(rtg_group(rtg), 0);
921921
if (!bdev_zone_is_seq(bio->bi_bdev, bio->bi_iter.bi_sector)) {
922922
/*
923923
* Also use the bio to drive the state machine when neither

0 commit comments

Comments
 (0)