| /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(sizeof(struct xfs_rtgroup), GFP_KERNEL); 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_rtbitmap.c | 155 struct xfs_inode *ip = args->rtg->rtg_inodes[type]; in xfs_rtbuf_get() 200 xfs_rtginode_mark_sick(args->rtg, type); in xfs_rtbuf_get() 210 xfs_rtginode_mark_sick(args->rtg, type); in xfs_rtbuf_get() 220 xfs_rtginode_mark_sick(args->rtg, type); in xfs_rtbuf_get() 239 xfs_rtginode_mark_sick(args->rtg, XFS_RTGI_BITMAP); in xfs_rtbitmap_read_buf() 254 xfs_rtginode_mark_sick(args->rtg, XFS_RTGI_SUMMARY); in xfs_rtsummary_read_buf() 594 uint8_t *rsum_cache = args->rtg->rtg_rsum_cache; in xfs_rtmodify_summary() 829 error = xfs_rtfind_forw(args, end, args->rtg->rtg_extents - 1, in xfs_rtfree_range() 1053 struct xfs_rtgroup *rtg, in xfs_rtfree_extent() argument 1058 struct xfs_inode *rbmip = rtg_bitmap(rtg); in xfs_rtfree_extent() [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_health.h | 257 #define xfs_rtgroup_has_sickness(rtg, mask) \ argument 258 xfs_group_has_sickness(rtg_group(rtg), (mask)) 259 #define xfs_rtgroup_is_healthy(rtg) \ argument 260 (!xfs_rtgroup_has_sickness((rtg), UINT_MAX)) 285 void xfs_rtgroup_geom_health(struct xfs_rtgroup *rtg,
|
| H A D | xfs_metafile.c | 260 struct xfs_rtgroup *rtg = NULL; in xfs_metafile_resv_init() local 280 while ((rtg = xfs_rtgroup_next(mp, rtg))) { in xfs_metafile_resv_init() 282 used += rtg_rmap(rtg)->i_nblocks; in xfs_metafile_resv_init() 286 used += rtg_refcount(rtg)->i_nblocks; in xfs_metafile_resv_init()
|
| H A D | xfs_rtrmap_btree.c | 506 struct xfs_rtgroup *rtg) in xfs_rtrmapbt_init_cursor() argument 508 struct xfs_inode *ip = rtg_rmap(rtg); in xfs_rtrmapbt_init_cursor() 509 struct xfs_mount *mp = rtg_mount(rtg); in xfs_rtrmapbt_init_cursor() 518 cur->bc_group = xfs_group_hold(rtg_group(rtg)); in xfs_rtrmapbt_init_cursor() 613 struct xfs_rtgroup *rtg, in xfs_rtrmapbt_mem_cursor() argument 617 struct xfs_mount *mp = rtg_mount(rtg); in xfs_rtrmapbt_mem_cursor() 624 cur->bc_group = xfs_group_hold(rtg_group(rtg)); in xfs_rtrmapbt_mem_cursor() 967 struct xfs_rtgroup *rtg, in xfs_rtrmapbt_create() argument 997 struct xfs_rtgroup *rtg, in xfs_rtrmapbt_init_rtsb() argument 1008 ASSERT(rtg_rgno(rtg) == 0); in xfs_rtrmapbt_init_rtsb() [all …]
|
| 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() 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() [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->rtg_group; 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 | 314 struct xfs_rtgroup *rtg = iter->victim_rtg; in xfs_zone_gc_query() local 321 ASSERT(iter->next_startblock <= rtg_blocks(rtg)); in xfs_zone_gc_query() 322 if (iter->next_startblock == rtg_blocks(rtg)) in xfs_zone_gc_query() 325 ASSERT(iter->next_startblock < rtg_blocks(rtg)); in xfs_zone_gc_query() 333 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP); in xfs_zone_gc_query() 334 cur = xfs_rtrmapbt_init_cursor(tp, rtg); in xfs_zone_gc_query() 337 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP); in xfs_zone_gc_query() 359 iter->next_startblock = rtg_blocks(rtg); in xfs_zone_gc_query() 451 struct xfs_rtgroup *rtg = xfs_rtgroup_grab(mp, bit); in xfs_zone_gc_pick_victim_from() local 453 if (!rtg) in xfs_zone_gc_pick_victim_from() [all …]
|
| H A D | xfs_health.c | 48 struct xfs_rtgroup *rtg = NULL; in xfs_health_unmount() local 61 while ((rtg = xfs_rtgroup_next(mp, rtg))) in xfs_health_unmount() 62 xfs_health_unmount_group(rtg_group(rtg), &warn); in xfs_health_unmount() 259 struct xfs_rtgroup *rtg = xfs_rtgroup_get(mp, rgno); in xfs_rgno_mark_sick() local 262 if (!rtg) in xfs_rgno_mark_sick() 265 xfs_group_mark_sick(rtg_group(rtg), mask); in xfs_rgno_mark_sick() 266 xfs_rtgroup_put(rtg); in xfs_rgno_mark_sick() 391 struct xfs_rtgroup *rtg = NULL; in xfs_fsop_geom_health() local 403 while ((rtg = xfs_rtgroup_next(mp, rtg))) { in xfs_fsop_geom_health() 404 xfs_group_measure_sickness(rtg_group(rtg), &sick, &checked); in xfs_fsop_geom_health() [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_notify_failure.c | 287 struct xfs_rtgroup *rtg = NULL; in xfs_dax_notify_dev_failure() local 302 rtg = to_rtg(xg); in xfs_dax_notify_dev_failure() 303 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP); in xfs_dax_notify_dev_failure() 304 cur = xfs_rtrmapbt_init_cursor(tp, rtg); in xfs_dax_notify_dev_failure() 329 if (rtg) in xfs_dax_notify_dev_failure() 330 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP); in xfs_dax_notify_dev_failure()
|
| /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 | 84 error = xchk_install_live_inode(sc, rtg_summary(sc->sr.rtg)); in xchk_setup_rtsummary() 157 be32_add_cpu(&v->rtg, 1); in xchk_rtsum_inc() 158 return be32_to_cpu(v->rtg); in xchk_rtsum_inc() 168 struct xfs_rtgroup *rtg, in xchk_rtsum_record_free() argument 173 struct xfs_mount *mp = rtg_mount(rtg); in xchk_rtsum_record_free() 192 rtbno = xfs_rtx_to_rtb(rtg, rec->ar_startext); in xchk_rtsum_record_free() 196 xchk_ino_xref_set_corrupt(sc, rtg_bitmap(rtg)->i_ino); in xchk_rtsum_record_free() 218 struct xfs_rtgroup *rtg = sc->sr.rtg; in xchk_rtsum_compute() local 222 rtg_bitmap(rtg)->i_disk_size) in xchk_rtsum_compute() 225 return xfs_rtalloc_query_all(rtg, sc->tp, xchk_rtsum_record_free, sc); in xchk_rtsum_compute() [all …]
|
| H A D | health.c | 171 struct xfs_rtgroup *rtg = NULL; in xchk_mark_all_healthy() local 176 while ((rtg = xfs_rtgroup_next(mp, rtg))) in xchk_mark_all_healthy() 177 xfs_group_mark_healthy(rtg_group(rtg), XFS_SICK_RG_INDIRECT); in xchk_mark_all_healthy() 195 struct xfs_rtgroup *rtg; in xchk_update_health() local 256 rtg = xfs_rtgroup_get(sc->mp, sc->sm->sm_agno); in xchk_update_health() 258 xfs_group_mark_corrupt(rtg_group(rtg), mask); in xchk_update_health() 260 xfs_group_mark_healthy(rtg_group(rtg), mask); in xchk_update_health() 261 xfs_rtgroup_put(rtg); in xchk_update_health() 316 struct xfs_rtgroup *rtg = NULL; in xchk_health_record() local 330 while ((rtg = xfs_rtgroup_next(mp, rtg))) { in xchk_health_record() [all …]
|
| H A D | rtrmap_repair.c | 132 if (xfs_rtrmap_check_irec(sc->sr.rtg, rec) != NULL) in xrep_rtrmap_check_mapping() 171 mcur = xfs_rtrmapbt_mem_cursor(sc->sr.rtg, sc->tp, &rr->rtrmap_btree); in xrep_rtrmap_stash() 233 rtg_rgno(rf->rr->sc->sr.rtg)) in xrep_rtrmap_visit_bmbt() 552 if (xfs_has_rtsb(sc->mp) && rtg_rgno(rr->sc->sr.rtg) == 0) { in xrep_rtrmap_find_rmaps() 633 mcur = xfs_rtrmapbt_mem_cursor(rr->sc->sr.rtg, NULL, &rr->rtrmap_btree); in xrep_rtrmap_find_rmaps() 713 struct xfs_rtgroup *rtg = sc->sr.rtg; in xrep_rtrmap_build_new_tree() local 731 rmap_cur = xfs_rtrmapbt_init_cursor(NULL, rtg); in xrep_rtrmap_build_new_tree() 751 error = xfs_trans_reserve_more_inode(sc->tp, rtg_rmap(rtg), in xrep_rtrmap_build_new_tree() 766 rr->mcur = xfs_rtrmapbt_mem_cursor(sc->sr.rtg, NULL, &rr->rtrmap_btree); in xrep_rtrmap_build_new_tree() 855 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 | common.c | 716 ASSERT(sr->rtg == NULL); in xchk_rtgroup_init() 719 sr->rtg = xfs_rtgroup_get(sc->mp, rgno); in xchk_rtgroup_init() 720 if (!sr->rtg) in xchk_rtgroup_init() 734 ASSERT(sr->rtg != NULL); in xchk_rtgroup_lock() 743 xfs_rtgroup_lock(sr->rtg, rtglock_flags); in xchk_rtgroup_lock() 752 xfs_rtgroup_lock(sr->rtg, rtglock_flags); in xchk_rtgroup_lock() 781 if (!xfs_group_intent_busy(rtg_group(sr->rtg))) in xchk_rtgroup_lock() 784 xfs_rtgroup_unlock(sr->rtg, rtglock_flags); in xchk_rtgroup_lock() 788 error = xfs_group_intent_drain(rtg_group(sr->rtg)); in xchk_rtgroup_lock() 799 sr->rmap_cur = xfs_rtrmapbt_init_cursor(sc->tp, sr->rtg); in xchk_rtgroup_lock() [all …]
|
| H A D | rtsummary_repair.c | 81 rts->args.rtg = sc->sr.rtg; in xrep_rtsummary_prep_buf() 178 if (sc->sr.rtg->rtg_rsum_cache) in xrep_rtsummary() 179 memset(sc->sr.rtg->rtg_rsum_cache, 0xFF, mp->m_sb.sb_rbmblocks); in xrep_rtsummary()
|
| H A D | rtbitmap_repair.c | 116 *word = be32_to_cpu(urk.rtg); in xfbmp_load() 130 urk.rtg = cpu_to_be32(word); in xfbmp_store() 188 struct xfs_rtgroup *rtg = sr->rtg; in xrep_rtbitmap_mark_free() local 199 if (!xfs_verify_rgbext(rtg, rtb->next_rgbno, rgbno - rtb->next_rgbno)) in xrep_rtbitmap_mark_free() 332 struct xfs_rtgroup *rtg = sc->sr.rtg; in xrep_rtbitmap_find_freespace() local 349 blockcount = rtg->rtg_extents * mp->m_sb.sb_rextsize; in xrep_rtbitmap_find_freespace() 516 struct xfs_group *xg = rtg_group(sc->sr.rtg); in xrep_rtbitmap()
|
| H A D | rgsuper.c | 37 xchk_xref_is_used_rt_space(sc, xfs_rgbno_to_rtb(sc->sr.rtg, 0), 1); in xchk_rgsuperblock_xref() 83 ASSERT(rtg_rgno(sc->sr.rtg) == 0); in xrep_rgsuperblock()
|