Lines Matching refs:rtg
50 uint8_t *rsum_cache = args->rtg->rtg_rsum_cache; in xfs_rtany_summary()
160 error = xfs_rtfind_forw(args, end, args->rtg->rtg_extents - 1, in xfs_rtallocate_range()
222 struct xfs_rtgroup *rtg, in xfs_rtallocate_clamp_len() argument
229 ret = min(rtg->rtg_extents, startrtx + rtxlen) - startrtx; in xfs_rtallocate_clamp_len()
264 end = min(args->rtg->rtg_extents, xfs_rbmblock_to_rtx(mp, bbno + 1)) - in xfs_rtallocate_extent_block()
268 scanlen = xfs_rtallocate_clamp_len(args->rtg, i, maxlen, prod); in xfs_rtallocate_extent_block()
363 scanlen = xfs_rtallocate_clamp_len(args->rtg, start, maxlen, prod); in xfs_rtallocate_extent_exact()
427 start = min(start, args->rtg->rtg_extents - 1); in xfs_rtallocate_extent_near()
661 struct xfs_rtgroup *rtg) in xfs_rtunmount_rtg() argument
666 xfs_rtginode_irele(&rtg->rtg_inodes[i]); in xfs_rtunmount_rtg()
667 if (!xfs_has_zoned(rtg_mount(rtg))) in xfs_rtunmount_rtg()
668 kvfree(rtg->rtg_rsum_cache); in xfs_rtunmount_rtg()
673 struct xfs_rtgroup *rtg, in xfs_alloc_rsum_cache() argument
680 rtg->rtg_rsum_cache = kvmalloc(rbmblocks, GFP_KERNEL); in xfs_alloc_rsum_cache()
681 if (!rtg->rtg_rsum_cache) in xfs_alloc_rsum_cache()
683 memset(rtg->rtg_rsum_cache, -1, rbmblocks); in xfs_alloc_rsum_cache()
723 struct xfs_rtgroup *rtg, in xfs_rtginode_ensure() argument
729 if (rtg->rtg_inodes[type]) in xfs_rtginode_ensure()
732 tp = xfs_trans_alloc_empty(rtg_mount(rtg)); in xfs_rtginode_ensure()
733 error = xfs_rtginode_load(rtg, type, tp); in xfs_rtginode_ensure()
738 return xfs_rtginode_create(rtg, type, true); in xfs_rtginode_ensure()
775 struct xfs_rtgroup *rtg, in xfs_growfs_rt_free_new() argument
779 struct xfs_mount *mp = rtg_mount(rtg); in xfs_growfs_rt_free_new()
780 xfs_rgnumber_t rgno = rtg_rgno(rtg); in xfs_growfs_rt_free_new()
799 struct xfs_rtgroup *rtg, in xfs_growfs_rt_nrblocks() argument
804 struct xfs_mount *mp = rtg_mount(rtg); in xfs_growfs_rt_nrblocks()
811 step = min(rgblocks, step) + rgblocks * rtg_rgno(rtg); in xfs_growfs_rt_nrblocks()
825 const struct xfs_rtgroup *rtg, in xfs_growfs_rt_init_rtsb() argument
834 if (rtg_rgno(rtg) > 0) in xfs_growfs_rt_init_rtsb()
855 if (rtg_rmap(args->rtg) != NULL) in xfs_growfs_rt_init_rtsb()
856 error = xfs_rtrmapbt_init_rtsb(nargs->mp, args->rtg, args->tp); in xfs_growfs_rt_init_rtsb()
890 struct xfs_rtgroup *rtg, in xfs_growfs_rt_zoned() argument
893 struct xfs_mount *mp = rtg_mount(rtg); in xfs_growfs_rt_zoned()
909 xfs_rtgroup_calc_geometry(nmp, rtg, rtg_rgno(rtg), in xfs_growfs_rt_zoned()
916 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP); in xfs_growfs_rt_zoned()
917 xfs_rtgroup_trans_join(tp, rtg, XFS_RTGLOCK_RMAP); in xfs_growfs_rt_zoned()
941 struct xfs_rtgroup *rtg, in xfs_growfs_rt_bmblock() argument
946 struct xfs_mount *mp = rtg_mount(rtg); in xfs_growfs_rt_bmblock()
947 struct xfs_inode *rbmip = rtg_bitmap(rtg); in xfs_growfs_rt_bmblock()
948 struct xfs_inode *rsumip = rtg_summary(rtg); in xfs_growfs_rt_bmblock()
951 .rtg = rtg, in xfs_growfs_rt_bmblock()
954 .rtg = rtg, in xfs_growfs_rt_bmblock()
965 xfs_growfs_rt_nrblocks(rtg, nrblocks, rextsize, bmbno), in xfs_growfs_rt_bmblock()
970 xfs_rtgroup_calc_geometry(nmp, rtg, rtg_rgno(rtg), in xfs_growfs_rt_bmblock()
984 xfs_rtgroup_lock(args.rtg, XFS_RTGLOCK_BITMAP | XFS_RTGLOCK_RMAP); in xfs_growfs_rt_bmblock()
985 xfs_rtgroup_trans_join(args.tp, args.rtg, in xfs_growfs_rt_bmblock()
1017 error = xfs_growfs_rt_init_rtsb(&nargs, rtg, &args); in xfs_growfs_rt_bmblock()
1029 error = xfs_growfs_rt_free_new(rtg, &nargs, &freed_rtx); in xfs_growfs_rt_bmblock()
1088 struct xfs_rtgroup *rtg) in xfs_last_rt_bmblock() argument
1090 struct xfs_mount *mp = rtg_mount(rtg); in xfs_last_rt_bmblock()
1091 xfs_rgnumber_t rgno = rtg_rgno(rtg); in xfs_last_rt_bmblock()
1113 struct xfs_rtgroup *rtg, in xfs_growfs_rt_alloc_blocks() argument
1118 struct xfs_mount *mp = rtg_mount(rtg); in xfs_growfs_rt_alloc_blocks()
1119 struct xfs_inode *rbmip = rtg_bitmap(rtg); in xfs_growfs_rt_alloc_blocks()
1120 struct xfs_inode *rsumip = rtg_summary(rtg); in xfs_growfs_rt_alloc_blocks()
1140 if (rtg_rgno(rtg) == nmp->m_sb.sb_rgcount - 1) in xfs_growfs_rt_alloc_blocks()
1145 rtg_rgno(rtg) == mp->m_sb.sb_rgcount - 1) in xfs_growfs_rt_alloc_blocks()
1156 error = xfs_rtfile_initialize_blocks(rtg, XFS_RTGI_BITMAP, orbmblocks, in xfs_growfs_rt_alloc_blocks()
1160 error = xfs_rtfile_initialize_blocks(rtg, XFS_RTGI_SUMMARY, orsumblocks, in xfs_growfs_rt_alloc_blocks()
1177 struct xfs_rtgroup *rtg; in xfs_growfs_rtg() local
1181 rtg = xfs_rtgroup_grab(mp, rgno); in xfs_growfs_rtg()
1182 if (!rtg) in xfs_growfs_rtg()
1186 error = xfs_rtginode_ensure(rtg, i); in xfs_growfs_rtg()
1192 error = xfs_growfs_rt_zoned(rtg, nrblocks); in xfs_growfs_rtg()
1196 error = xfs_growfs_rt_alloc_blocks(rtg, nrblocks, rextsize, &bmblocks); in xfs_growfs_rtg()
1200 if (bmblocks != rtg_mount(rtg)->m_sb.sb_rbmblocks) { in xfs_growfs_rtg()
1201 old_rsum_cache = rtg->rtg_rsum_cache; in xfs_growfs_rtg()
1202 error = xfs_alloc_rsum_cache(rtg, bmblocks); in xfs_growfs_rtg()
1207 for (bmbno = xfs_last_rt_bmblock(rtg); bmbno < bmblocks; bmbno++) { in xfs_growfs_rtg()
1208 error = xfs_growfs_rt_bmblock(rtg, nrblocks, rextsize, bmbno); in xfs_growfs_rtg()
1220 xfs_rtgroup_calc_geometry(mp, rtg, rtg_rgno(rtg), mp->m_sb.sb_rgcount, in xfs_growfs_rtg()
1223 kvfree(rtg->rtg_rsum_cache); in xfs_growfs_rtg()
1224 rtg->rtg_rsum_cache = old_rsum_cache; in xfs_growfs_rtg()
1227 xfs_rtgroup_rele(rtg); in xfs_growfs_rtg()
1454 struct xfs_rtgroup *rtg; in xfs_growfs_rt() local
1456 rtg = xfs_rtgroup_grab(mp, rgno); in xfs_growfs_rt()
1457 if (!WARN_ON_ONCE(!rtg)) { in xfs_growfs_rt()
1458 xfs_rtunmount_rtg(rtg); in xfs_growfs_rt()
1459 xfs_rtgroup_rele(rtg); in xfs_growfs_rt()
1564 struct xfs_rtgroup *rtg, in xfs_rtalloc_count_frextent() argument
1586 struct xfs_rtgroup *rtg = NULL; in xfs_rtalloc_reinit_frextents() local
1588 while ((rtg = xfs_rtgroup_next(mp, rtg))) { in xfs_rtalloc_reinit_frextents()
1589 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_BITMAP_SHARED); in xfs_rtalloc_reinit_frextents()
1590 error = xfs_rtalloc_query_all(rtg, NULL, in xfs_rtalloc_reinit_frextents()
1592 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_BITMAP_SHARED); in xfs_rtalloc_reinit_frextents()
1594 xfs_rtgroup_rele(rtg); in xfs_rtalloc_reinit_frextents()
1639 struct xfs_rtgroup *rtg) in xfs_rtmount_rtg() argument
1644 error = xfs_rtginode_load(rtg, i, tp); in xfs_rtmount_rtg()
1648 if (rtg->rtg_inodes[i]) { in xfs_rtmount_rtg()
1650 rtg->rtg_inodes[i]); in xfs_rtmount_rtg()
1658 return xfs_alloc_rsum_cache(rtg, mp->m_sb.sb_rbmblocks); in xfs_rtmount_rtg()
1670 struct xfs_rtgroup *rtg = NULL; in xfs_rtmount_inodes() local
1680 while ((rtg = xfs_rtgroup_next(mp, rtg))) { in xfs_rtmount_inodes()
1681 error = xfs_rtmount_rtg(mp, tp, rtg); in xfs_rtmount_inodes()
1683 xfs_rtgroup_rele(rtg); in xfs_rtmount_inodes()
1698 struct xfs_rtgroup *rtg = NULL; in xfs_rtunmount_inodes() local
1700 while ((rtg = xfs_rtgroup_next(mp, rtg))) in xfs_rtunmount_inodes()
1701 xfs_rtunmount_rtg(rtg); in xfs_rtunmount_inodes()
1714 struct xfs_rtgroup *rtg, in xfs_rtpick_extent() argument
1718 struct xfs_mount *mp = rtg_mount(rtg); in xfs_rtpick_extent()
1719 struct xfs_inode *rbmip = rtg_bitmap(rtg); in xfs_rtpick_extent()
1794 struct xfs_rtgroup *rtg = args->rtg; in xfs_rtalloc_check_busy() local
1795 struct xfs_mount *mp = rtg_mount(rtg); in xfs_rtalloc_check_busy()
1796 xfs_agblock_t rgbno = xfs_rtx_to_rgbno(rtg, rtx); in xfs_rtalloc_check_busy()
1797 xfs_rgblock_t min_rgbno = xfs_rtx_to_rgbno(rtg, start); in xfs_rtalloc_check_busy()
1803 busy = xfs_extent_busy_trim(rtg_group(rtg), minlen, in xfs_rtalloc_check_busy()
1868 trace_xfs_rtalloc_extent_busy(args->rtg, start, minlen, maxlen, in xfs_rtallocate_adjust_for_busy()
1871 error = xfs_extent_busy_flush(args->tp, rtg_group(args->rtg), in xfs_rtallocate_adjust_for_busy()
1880 trace_xfs_rtalloc_extent_busy_trim(args->rtg, *rtx, *len, resrtx, in xfs_rtallocate_adjust_for_busy()
1911 args.rtg = xfs_rtgroup_grab(args.mp, rgno); in xfs_rtallocate_rtg()
1912 if (!args.rtg) in xfs_rtallocate_rtg()
1934 xfs_rtgroup_lock(args.rtg, XFS_RTGLOCK_BITMAP); in xfs_rtallocate_rtg()
1936 xfs_rtgroup_trans_join(tp, args.rtg, in xfs_rtallocate_rtg()
1948 start = xfs_rtpick_extent(args.rtg, tp, maxlen); in xfs_rtallocate_rtg()
1980 xfs_rtgroup_trans_join(tp, args.rtg, XFS_RTGLOCK_BITMAP); in xfs_rtallocate_rtg()
1990 *bno = xfs_rtx_to_rtb(args.rtg, rtx); in xfs_rtallocate_rtg()
1994 xfs_rtgroup_rele(args.rtg); in xfs_rtallocate_rtg()
1998 xfs_rtgroup_unlock(args.rtg, XFS_RTGLOCK_BITMAP); in xfs_rtallocate_rtg()