Lines Matching refs:rtg
313 struct xfs_rtgroup *rtg = iter->victim_rtg; in xfs_zone_gc_query() local
320 ASSERT(iter->next_startblock <= rtg_blocks(rtg)); in xfs_zone_gc_query()
321 if (iter->next_startblock == rtg_blocks(rtg)) in xfs_zone_gc_query()
324 ASSERT(iter->next_startblock < rtg_blocks(rtg)); in xfs_zone_gc_query()
332 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP); in xfs_zone_gc_query()
333 cur = xfs_rtrmapbt_init_cursor(tp, rtg); in xfs_zone_gc_query()
336 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP); in xfs_zone_gc_query()
358 iter->next_startblock = rtg_blocks(rtg); in xfs_zone_gc_query()
449 struct xfs_rtgroup *rtg = xfs_rtgroup_grab(mp, bit); in xfs_zone_gc_pick_victim_from() local
451 if (!rtg) in xfs_zone_gc_pick_victim_from()
455 if (rtg_rmap(rtg)->i_used_blocks == 0 || in xfs_zone_gc_pick_victim_from()
456 rtg_rmap(rtg)->i_used_blocks >= victim_used) { in xfs_zone_gc_pick_victim_from()
457 xfs_rtgroup_rele(rtg); in xfs_zone_gc_pick_victim_from()
463 victim_rtg = rtg; in xfs_zone_gc_pick_victim_from()
464 victim_used = rtg_rmap(rtg)->i_used_blocks; in xfs_zone_gc_pick_victim_from()
473 rtg_rmap(rtg)->i_used_blocks < rtg_blocks(rtg) / 100) in xfs_zone_gc_pick_victim_from()
879 struct xfs_rtgroup *rtg = chunk->bio.bi_private; in xfs_zone_gc_finish_reset() local
880 struct xfs_mount *mp = rtg_mount(rtg); in xfs_zone_gc_finish_reset()
888 xfs_group_set_mark(&rtg->rtg_group, XFS_RTG_FREE); in xfs_zone_gc_finish_reset()
891 xfs_zoned_add_available(mp, rtg_blocks(rtg)); in xfs_zone_gc_finish_reset()
902 struct xfs_rtgroup *rtg) in xfs_zone_gc_prepare_reset() argument
904 trace_xfs_zone_reset(rtg); in xfs_zone_gc_prepare_reset()
906 ASSERT(rtg_rmap(rtg)->i_used_blocks == 0); in xfs_zone_gc_prepare_reset()
907 bio->bi_iter.bi_sector = xfs_gbno_to_daddr(&rtg->rtg_group, 0); in xfs_zone_gc_prepare_reset()
913 XFS_FSB_TO_B(rtg_mount(rtg), rtg_blocks(rtg)); in xfs_zone_gc_prepare_reset()
921 struct xfs_rtgroup *rtg) in xfs_zone_gc_reset_sync() argument
926 bio_init(&bio, rtg_mount(rtg)->m_rtdev_targp->bt_bdev, NULL, 0, in xfs_zone_gc_reset_sync()
928 if (xfs_zone_gc_prepare_reset(&bio, rtg)) in xfs_zone_gc_reset_sync()
948 struct xfs_rtgroup *rtg = to_rtg(next); in xfs_zone_gc_reset_zones() local
952 xfs_log_force_inode(rtg_rmap(rtg)); in xfs_zone_gc_reset_zones()
954 next = rtg_group(rtg)->xg_next_reset; in xfs_zone_gc_reset_zones()
955 rtg_group(rtg)->xg_next_reset = NULL; in xfs_zone_gc_reset_zones()
957 bio = bio_alloc_bioset(rtg_mount(rtg)->m_rtdev_targp->bt_bdev, in xfs_zone_gc_reset_zones()
959 bio->bi_private = rtg; in xfs_zone_gc_reset_zones()
971 if (xfs_zone_gc_prepare_reset(bio, rtg)) in xfs_zone_gc_reset_zones()