| /linux/fs/xfs/libxfs/ |
| H A D | xfs_rtgroup.h | 72 static inline struct xfs_group *rtg_group(struct xfs_rtgroup *rtg) in rtg_group() argument 74 return &rtg->rtg_group; in rtg_group() 77 static inline struct xfs_mount *rtg_mount(const struct xfs_rtgroup *rtg) in rtg_mount() argument 79 return rtg->rtg_group.xg_mount; in rtg_mount() 82 static inline xfs_rgnumber_t rtg_rgno(const struct xfs_rtgroup *rtg) in rtg_rgno() argument 84 return rtg->rtg_group.xg_gno; in rtg_rgno() 87 static inline xfs_rgblock_t rtg_blocks(const struct xfs_rtgroup *rtg) in rtg_blocks() argument 89 return rtg->rtg_group.xg_block_count; in rtg_blocks() 92 static inline struct xfs_inode *rtg_bitmap(const struct xfs_rtgroup *rtg) in rtg_bitmap() argument 94 return rtg->rtg_inodes[XFS_RTGI_BITMAP]; in rtg_bitmap() [all …]
|
| H A D | xfs_rtgroup.c | 80 struct xfs_rtgroup *rtg, in xfs_rtgroup_calc_geometry() argument 85 rtg->rtg_extents = __xfs_rtgroup_extents(mp, rgno, rgcount, rextents); in xfs_rtgroup_calc_geometry() 86 rtg_group(rtg)->xg_block_count = in xfs_rtgroup_calc_geometry() 87 rtg->rtg_extents * mp->m_sb.sb_rextsize; in xfs_rtgroup_calc_geometry() 88 rtg_group(rtg)->xg_min_gbno = xfs_rtgroup_min_block(mp, rgno); in xfs_rtgroup_calc_geometry() 98 struct xfs_rtgroup *rtg; in xfs_rtgroup_alloc() local 101 rtg = kzalloc_obj(struct xfs_rtgroup); in xfs_rtgroup_alloc() 102 if (!rtg) in xfs_rtgroup_alloc() 105 xfs_rtgroup_calc_geometry(mp, rtg, rgno, rgcount, rextents); in xfs_rtgroup_alloc() 107 error = xfs_group_insert(mp, rtg_group(rtg), rgno, XG_TYPE_RTG); in xfs_rtgroup_alloc() [all …]
|
| H A D | xfs_rtbitmap.h | 12 struct xfs_rtgroup *rtg; member 25 struct xfs_rtgroup *rtg, in xfs_rtx_to_rtb() argument 28 struct xfs_mount *mp = rtg_mount(rtg); in xfs_rtx_to_rtb() 29 xfs_rtblock_t start = xfs_group_start_fsb(rtg_group(rtg)); in xfs_rtx_to_rtb() 245 return be32_to_cpu(word->rtg); in xfs_rtbitmap_getword() 259 word->rtg = cpu_to_be32(value); in xfs_rtbitmap_setword() 335 return be32_to_cpu(info->rtg); in xfs_suminfo_get() 349 be32_add_cpu(&info->rtg, delta); in xfs_suminfo_add() 350 return be32_to_cpu(info->rtg); in xfs_suminfo_add() 379 struct xfs_rtgroup *rtg, [all …]
|
| H A D | xfs_rtrmap_btree.h | 20 struct xfs_rtgroup *rtg); 22 struct xfs_rtgroup *rtg, struct xfs_inode *ip, 197 int xfs_rtrmapbt_create(struct xfs_rtgroup *rtg, struct xfs_inode *ip, 199 int xfs_rtrmapbt_init_rtsb(struct xfs_mount *mp, struct xfs_rtgroup *rtg, 205 struct xfs_btree_cur *xfs_rtrmapbt_mem_cursor(struct xfs_rtgroup *rtg, 210 xfs_rgblock_t xfs_rtrmap_highest_rgbno(struct xfs_rtgroup *rtg);
|
| H A D | xfs_metafile.c | 265 struct xfs_rtgroup *rtg = NULL; in xfs_metafile_resv_init() local 285 while ((rtg = xfs_rtgroup_next(mp, rtg))) { in xfs_metafile_resv_init() 287 used += rtg_rmap(rtg)->i_nblocks; in xfs_metafile_resv_init() 291 used += rtg_refcount(rtg)->i_nblocks; in xfs_metafile_resv_init()
|
| H A D | xfs_rtrefcount_btree.h | 19 struct xfs_rtgroup *rtg); 21 struct xfs_rtgroup *rtg, struct xfs_inode *ip, 186 int xfs_rtrefcountbt_create(struct xfs_rtgroup *rtg, struct xfs_inode *ip,
|
| /linux/fs/xfs/ |
| H A D | xfs_rtalloc.c | 50 uint8_t *rsum_cache = args->rtg->rtg_rsum_cache; in xfs_rtany_summary() 163 error = xfs_rtfind_forw(args, end, args->rtg->rtg_extents - 1, in xfs_rtallocate_range() 225 struct xfs_rtgroup *rtg, in xfs_rtallocate_clamp_len() argument 232 ret = min(rtg->rtg_extents, startrtx + rtxlen) - startrtx; in xfs_rtallocate_clamp_len() 267 end = min(args->rtg->rtg_extents, xfs_rbmblock_to_rtx(mp, bbno + 1)) - in xfs_rtallocate_extent_block() 271 scanlen = xfs_rtallocate_clamp_len(args->rtg, i, maxlen, prod); in xfs_rtallocate_extent_block() 366 scanlen = xfs_rtallocate_clamp_len(args->rtg, start, maxlen, prod); in xfs_rtallocate_extent_exact() 430 start = min(start, args->rtg->rtg_extents - 1); in xfs_rtallocate_extent_near() 664 struct xfs_rtgroup *rtg) in xfs_rtunmount_rtg() argument 669 xfs_rtginode_irele(&rtg->rtg_inodes[i]); in xfs_rtunmount_rtg() [all …]
|
| H A D | xfs_zone_alloc.c | 78 struct xfs_rtgroup *rtg, in xfs_zone_account_reclaimable() argument 81 struct xfs_group *xg = rtg_group(rtg); in xfs_zone_account_reclaimable() 82 struct xfs_mount *mp = rtg_mount(rtg); in xfs_zone_account_reclaimable() 84 uint32_t used = rtg_rmap(rtg)->i_used_blocks; in xfs_zone_account_reclaimable() 85 xfs_rgnumber_t rgno = rtg_rgno(rtg); in xfs_zone_account_reclaimable() 88 bool was_full = (used + freed == rtg_blocks(rtg)); in xfs_zone_account_reclaimable() 104 trace_xfs_zone_emptied(rtg); in xfs_zone_account_reclaimable() 167 struct xfs_rtgroup *rtg = oz->oz_rtg; in xfs_open_zone_mark_full() local 168 struct xfs_mount *mp = rtg_mount(rtg); in xfs_open_zone_mark_full() 170 uint32_t used = rtg_rmap(rtg)->i_used_blocks; in xfs_open_zone_mark_full() [all …]
|
| H A D | xfs_discard.c | 512 struct xfs_rtgroup *rtg, in xfs_trim_gather_rtextent() argument 531 rbno = xfs_rtx_to_rtb(rtg, rec->ar_startext); in xfs_trim_gather_rtextent() 532 rlen = xfs_rtbxlen_to_blen(rtg_mount(rtg), rec->ar_extcount); in xfs_trim_gather_rtextent() 536 trace_xfs_discard_rttoosmall(rtg_mount(rtg), rbno, rlen); in xfs_trim_gather_rtextent() 556 struct xfs_rtgroup *rtg, in xfs_trim_rtextents() argument 561 struct xfs_mount *mp = rtg_mount(rtg); in xfs_trim_rtextents() 577 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_BITMAP_SHARED); in xfs_trim_rtextents() 578 error = xfs_rtalloc_query_range(rtg, tp, low, high, in xfs_trim_rtextents() 584 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_BITMAP_SHARED); in xfs_trim_rtextents() 590 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_BITMAP_SHARED); in xfs_trim_rtextents() [all …]
|
| H A D | xfs_zone_gc.c | 306 struct xfs_rtgroup *rtg = iter->victim_rtg; in xfs_zone_gc_query() local 313 ASSERT(iter->next_startblock <= rtg_blocks(rtg)); in xfs_zone_gc_query() 314 if (iter->next_startblock == rtg_blocks(rtg)) in xfs_zone_gc_query() 317 ASSERT(iter->next_startblock < rtg_blocks(rtg)); in xfs_zone_gc_query() 325 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP); in xfs_zone_gc_query() 326 cur = xfs_rtrmapbt_init_cursor(tp, rtg); in xfs_zone_gc_query() 329 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP); in xfs_zone_gc_query() 351 iter->next_startblock = rtg_blocks(rtg); in xfs_zone_gc_query() 443 struct xfs_rtgroup *rtg = xfs_rtgroup_grab(mp, bit); in xfs_zone_gc_pick_victim_from() local 445 if (!rtg) in xfs_zone_gc_pick_victim_from() [all …]
|
| H A D | xfs_fsmap.c | 717 struct xfs_rtgroup *rtg, in xfs_getfsmap_rtdev_rtbitmap_helper() argument 725 struct xfs_mount *mp = rtg_mount(rtg); in xfs_getfsmap_rtdev_rtbitmap_helper() 728 xfs_rtx_to_rtb(rtg, rec->ar_startext); in xfs_getfsmap_rtdev_rtbitmap_helper() 761 struct xfs_rtgroup *rtg = NULL; in xfs_getfsmap_rtdev_rtbitmap() local 790 while ((rtg = xfs_rtgroup_next_range(mp, rtg, start_rgno, end_rgno))) { in xfs_getfsmap_rtdev_rtbitmap() 791 if (rtg_rgno(rtg) == end_rgno) in xfs_getfsmap_rtdev_rtbitmap() 795 info->group = rtg_group(rtg); in xfs_getfsmap_rtdev_rtbitmap() 796 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_BITMAP_SHARED); in xfs_getfsmap_rtdev_rtbitmap() 797 error = xfs_rtalloc_query_range(rtg, tp, start_rtx, end_rtx, in xfs_getfsmap_rtdev_rtbitmap() 807 if (rtg_rgno(rtg) == end_rgno) { in xfs_getfsmap_rtdev_rtbitmap() [all …]
|
| H A D | xfs_health.c | 51 struct xfs_rtgroup *rtg = NULL; in xfs_health_unmount() local 64 while ((rtg = xfs_rtgroup_next(mp, rtg))) in xfs_health_unmount() 65 xfs_health_unmount_group(rtg_group(rtg), &warn); in xfs_health_unmount() 307 struct xfs_rtgroup *rtg = xfs_rtgroup_get(mp, rgno); in xfs_rgno_mark_sick() local 310 if (!rtg) in xfs_rgno_mark_sick() 313 xfs_group_mark_sick(rtg_group(rtg), mask); in xfs_rgno_mark_sick() 314 xfs_rtgroup_put(rtg); in xfs_rgno_mark_sick() 478 struct xfs_rtgroup *rtg = NULL; in xfs_fsop_geom_health() local 490 while ((rtg = xfs_rtgroup_next(mp, rtg))) { in xfs_fsop_geom_health() 491 xfs_group_measure_sickness(rtg_group(rtg), &sick, &checked); in xfs_fsop_geom_health() [all …]
|
| H A D | xfs_notify_failure.c | 298 struct xfs_rtgroup *rtg = NULL; in xfs_dax_notify_dev_failure() local 313 rtg = to_rtg(xg); in xfs_dax_notify_dev_failure() 314 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP); in xfs_dax_notify_dev_failure() 315 cur = xfs_rtrmapbt_init_cursor(tp, rtg); in xfs_dax_notify_dev_failure() 340 if (rtg) in xfs_dax_notify_dev_failure() 341 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP); in xfs_dax_notify_dev_failure()
|
| H A D | xfs_verify_media.c | 114 struct xfs_rtgroup *rtg = NULL; in xfs_verify_report_losses() local 131 rtg = to_rtg(xg); in xfs_verify_report_losses() 132 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP); in xfs_verify_report_losses() 133 cur = xfs_rtrmapbt_init_cursor(tp, rtg); in xfs_verify_report_losses() 158 if (rtg) in xfs_verify_report_losses() 159 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP); in xfs_verify_report_losses()
|
| H A D | xfs_zone_alloc.h | 34 int xfs_zone_free_blocks(struct xfs_trans *tp, struct xfs_rtgroup *rtg, 42 bool xfs_zone_rgbno_is_valid(struct xfs_rtgroup *rtg, xfs_rgnumber_t rgbno);
|
| H A D | xfs_extent_busy.c | 668 struct xfs_rtgroup *rtg = NULL; in xfs_extent_busy_wait_all() local 674 while ((rtg = xfs_rtgroup_next(mp, rtg))) in xfs_extent_busy_wait_all() 675 xfs_extent_busy_wait_group(rtg_group(rtg)); in xfs_extent_busy_wait_all()
|
| H A D | xfs_drain.h | 70 void xfs_group_intent_put(struct xfs_group *rtg);
|
| /linux/fs/xfs/scrub/ |
| H A D | rtbitmap.c | 65 error = xchk_install_live_inode(sc, rtg_bitmap(sc->sr.rtg)); in xchk_setup_rtbitmap() 121 struct xfs_rtgroup *rtg, in xchk_rtbitmap_rec() argument 131 startblock = xfs_rtx_to_rtb(rtg, rec->ar_startext); in xchk_rtbitmap_rec() 132 blockcount = xfs_rtxlen_to_extlen(rtg_mount(rtg), rec->ar_extcount); in xchk_rtbitmap_rec() 134 if (!xfs_verify_rtbext(rtg_mount(rtg), startblock, blockcount)) in xchk_rtbitmap_rec() 195 struct xfs_rtgroup *rtg = sc->sr.rtg; in xchk_rtbitmap() local 196 struct xfs_inode *rbmip = rtg_bitmap(rtg); in xchk_rtbitmap() 252 error = xfs_rtalloc_query_all(rtg, sc->tp, xchk_rtbitmap_rec, rtb); in xchk_rtbitmap() 261 last_rgbno = rtg->rtg_extents * mp->m_sb.sb_rextsize - 1; in xchk_rtbitmap() 275 struct xfs_rtgroup *rtg = sc->sr.rtg; in xchk_xref_is_used_rt_space() local [all …]
|
| H A D | rtsummary.c | 80 error = xchk_install_live_inode(sc, rtg_summary(sc->sr.rtg)); in xchk_setup_rtsummary() 153 be32_add_cpu(&v->rtg, 1); in xchk_rtsum_inc() 154 return be32_to_cpu(v->rtg); in xchk_rtsum_inc() 164 struct xfs_rtgroup *rtg, in xchk_rtsum_record_free() argument 169 struct xfs_mount *mp = rtg_mount(rtg); in xchk_rtsum_record_free() 188 rtbno = xfs_rtx_to_rtb(rtg, rec->ar_startext); in xchk_rtsum_record_free() 192 xchk_ino_xref_set_corrupt(sc, rtg_bitmap(rtg)->i_ino); in xchk_rtsum_record_free() 214 struct xfs_rtgroup *rtg = sc->sr.rtg; in xchk_rtsum_compute() local 218 rtg_bitmap(rtg)->i_disk_size) in xchk_rtsum_compute() 221 return xfs_rtalloc_query_all(rtg, sc->tp, xchk_rtsum_record_free, sc); in xchk_rtsum_compute() [all …]
|
| H A D | rtrmap_repair.c | 129 if (xfs_rtrmap_check_irec(sc->sr.rtg, rec) != NULL) in xrep_rtrmap_check_mapping() 168 mcur = xfs_rtrmapbt_mem_cursor(sc->sr.rtg, sc->tp, &rr->rtrmap_btree); in xrep_rtrmap_stash() 230 rtg_rgno(rf->rr->sc->sr.rtg)) in xrep_rtrmap_visit_bmbt() 549 if (xfs_has_rtsb(sc->mp) && rtg_rgno(rr->sc->sr.rtg) == 0) { in xrep_rtrmap_find_rmaps() 630 mcur = xfs_rtrmapbt_mem_cursor(rr->sc->sr.rtg, NULL, &rr->rtrmap_btree); in xrep_rtrmap_find_rmaps() 710 struct xfs_rtgroup *rtg = sc->sr.rtg; in xrep_rtrmap_build_new_tree() local 728 rmap_cur = xfs_rtrmapbt_init_cursor(NULL, rtg); in xrep_rtrmap_build_new_tree() 748 error = xfs_trans_reserve_more_inode(sc->tp, rtg_rmap(rtg), in xrep_rtrmap_build_new_tree() 763 rr->mcur = xfs_rtrmapbt_mem_cursor(sc->sr.rtg, NULL, &rr->rtrmap_btree); in xrep_rtrmap_build_new_tree() 852 trace_xrep_rmap_live_update(rtg_group(rr->sc->sr.rtg), action, p); in xrep_rtrmapbt_live_update() [all …]
|
| H A D | fscounters.c | 391 struct xfs_rtgroup *rtg, in xchk_fscount_add_frextent() argument 412 struct xfs_rtgroup *rtg = NULL; in xchk_fscount_count_frextents() local 426 while ((rtg = xfs_rtgroup_next(mp, rtg))) { in xchk_fscount_count_frextents() 427 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_BITMAP_SHARED); in xchk_fscount_count_frextents() 428 error = xfs_rtalloc_query_all(rtg, sc->tp, in xchk_fscount_count_frextents() 430 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_BITMAP_SHARED); in xchk_fscount_count_frextents() 433 xfs_rtgroup_rele(rtg); in xchk_fscount_count_frextents()
|
| H A D | metapath.c | 144 struct xfs_rtgroup *rtg; in xchk_setup_metapath_rtginode() local 148 rtg = xfs_rtgroup_get(sc->mp, sc->sm->sm_agno); in xchk_setup_metapath_rtginode() 149 if (!rtg) in xchk_setup_metapath_rtginode() 152 ip = rtg->rtg_inodes[type]; in xchk_setup_metapath_rtginode() 159 xfs_rtginode_path(rtg_rgno(rtg), type), ip); in xchk_setup_metapath_rtginode() 162 xfs_rtgroup_put(rtg); in xchk_setup_metapath_rtginode()
|
| H A D | bmap_repair.c | 451 struct xfs_rtgroup *rtg) in xrep_bmap_scan_rtgroup() argument 459 error = xrep_rtgroup_init(sc, rtg, &sc->sr, in xrep_bmap_scan_rtgroup() 473 xrep_bmap_scan_rtgroup(struct xrep_bmap *rb, struct xfs_rtgroup *rtg) in xrep_bmap_scan_rtgroup() argument 535 struct xfs_rtgroup *rtg = NULL; in xrep_bmap_find_mappings() local 537 while ((rtg = xfs_rtgroup_next(sc->mp, rtg))) { in xrep_bmap_find_mappings() 538 error = xrep_bmap_scan_rtgroup(rb, rtg); in xrep_bmap_find_mappings() 540 xfs_rtgroup_rele(rtg); in xrep_bmap_find_mappings()
|
| H A D | rtrefcount_repair.c | 142 if (xfs_rtrefcount_check_irec(sc->sr.rtg, rec) != NULL) in xrep_rtrefc_check_ext() 183 trace_xrep_refc_found(rtg_group(rr->sc->sr.rtg), &irec); in xrep_rtrefc_stash() 613 struct xfs_rtgroup *rtg = sc->sr.rtg; in xrep_rtrefc_build_new_tree() local 635 refc_cur = xfs_rtrefcountbt_init_cursor(NULL, rtg); in xrep_rtrefc_build_new_tree() 655 error = xfs_trans_reserve_more_inode(sc->tp, rtg_refcount(rtg), in xrep_rtrefc_build_new_tree()
|
| H A D | cow_repair.c | 330 struct xfs_rtgroup *rtg; in xrep_cow_find_bad_rt() local 335 rtg = xfs_rtgroup_get(sc->mp, in xrep_cow_find_bad_rt() 337 if (!rtg) in xrep_cow_find_bad_rt() 340 error = xrep_rtgroup_init(sc, rtg, &sc->sr, in xrep_cow_find_bad_rt() 366 xfs_rgbno_to_rtb(rtg, xc->next_bno), in xrep_cow_find_bad_rt() 399 xfs_rtgroup_put(rtg); in xrep_cow_find_bad_rt()
|