| /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_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_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() 969 struct xfs_rtgroup *rtg, in xfs_rtrmapbt_create() argument 999 struct xfs_rtgroup *rtg, in xfs_rtrmapbt_init_rtsb() argument 1010 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() 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 | 79 struct xfs_rtgroup *rtg, in xfs_zone_account_reclaimable() argument 82 struct xfs_group *xg = rtg_group(rtg); in xfs_zone_account_reclaimable() 83 struct xfs_mount *mp = rtg_mount(rtg); in xfs_zone_account_reclaimable() 85 uint32_t used = rtg_rmap(rtg)->i_used_blocks; in xfs_zone_account_reclaimable() 86 xfs_rgnumber_t rgno = rtg_rgno(rtg); in xfs_zone_account_reclaimable() 89 bool was_full = (used + freed == rtg_blocks(rtg)); in xfs_zone_account_reclaimable() 105 trace_xfs_zone_emptied(rtg); in xfs_zone_account_reclaimable() 168 struct xfs_rtgroup *rtg = oz->oz_rtg; in xfs_open_zone_mark_full() local 169 struct xfs_mount *mp = rtg_mount(rtg); in xfs_open_zone_mark_full() 171 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 | 329 struct xfs_rtgroup *rtg = iter->victim_rtg; in xfs_zone_gc_query() local 336 ASSERT(iter->next_startblock <= rtg_blocks(rtg)); in xfs_zone_gc_query() 337 if (iter->next_startblock == rtg_blocks(rtg)) in xfs_zone_gc_query() 340 ASSERT(iter->next_startblock < rtg_blocks(rtg)); in xfs_zone_gc_query() 348 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP); in xfs_zone_gc_query() 349 cur = xfs_rtrmapbt_init_cursor(tp, rtg); in xfs_zone_gc_query() 352 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP); in xfs_zone_gc_query() 374 iter->next_startblock = rtg_blocks(rtg); in xfs_zone_gc_query() 463 struct xfs_rtgroup *rtg = xfs_rtgroup_grab(mp, bit); in xfs_zone_gc_pick_victim_from() local 465 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_ioctl.c | 414 struct xfs_rtgroup *rtg, in xfs_rtgroup_report_write_pointer() argument 417 xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP); in xfs_rtgroup_report_write_pointer() 418 if (rtg->rtg_open_zone) { in xfs_rtgroup_report_write_pointer() 419 rgeo->rg_writepointer = rtg->rtg_open_zone->oz_allocated; in xfs_rtgroup_report_write_pointer() 421 xfs_rgblock_t highest_rgbno = xfs_rtrmap_highest_rgbno(rtg); in xfs_rtgroup_report_write_pointer() 428 xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP); in xfs_rtgroup_report_write_pointer() 437 struct xfs_rtgroup *rtg; in xfs_ioc_rtgroup_geometry() local 450 rtg = xfs_rtgroup_get(mp, rgeo.rg_number); in xfs_ioc_rtgroup_geometry() 451 if (!rtg) in xfs_ioc_rtgroup_geometry() 454 error = xfs_rtgroup_get_geometry(rtg, &rgeo); in xfs_ioc_rtgroup_geometry() [all …]
|
| /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; 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_ip_xref_set_corrupt(sc, rtg_bitmap(rtg)); 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 | 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 | 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 | rtsummary_repair.c | 81 rts->args.rtg = sc->sr.rtg; in xrep_rtsummary_prep_buf() 179 if (sc->sr.rtg->rtg_rsum_cache) in xrep_rtsummary() 180 memset(sc->sr.rtg->rtg_rsum_cache, 0xFF, mp->m_sb.sb_rbmblocks); in xrep_rtsummary()
|
| H A D | rtbitmap_repair.c | 119 *word = be32_to_cpu(urk.rtg); in xfbmp_load() 133 urk.rtg = cpu_to_be32(word); in xfbmp_store() 191 struct xfs_rtgroup *rtg = sr->rtg; in xrep_rtbitmap_mark_free() local 202 if (!xfs_verify_rgbext(rtg, rtb->next_rgbno, rgbno - rtb->next_rgbno)) in xrep_rtbitmap_mark_free() 335 struct xfs_rtgroup *rtg = sc->sr.rtg; in xrep_rtbitmap_find_freespace() local 352 blockcount = rtg->rtg_extents * mp->m_sb.sb_rextsize; in xrep_rtbitmap_find_freespace() 519 struct xfs_group *xg = rtg_group(sc->sr.rtg); in xrep_rtbitmap()
|
| H A D | rgsuper.c | 39 xchk_xref_is_used_rt_space(sc, xfs_rgbno_to_rtb(sc->sr.rtg, 0), in xchk_rgsuperblock_xref() 95 ASSERT(rtg_rgno(sc->sr.rtg) == 0); in xrep_rgsuperblock()
|
| H A D | reap.c | 921 cur = xfs_rtrmapbt_init_cursor(sc->tp, sc->sr.rtg); in xreap_rgextent_select() 947 trace_xreap_agextent_select(rtg_group(sc->sr.rtg), rgbno, len, in xreap_rgextent_select() 980 rtbno = xfs_rgbno_to_rtb(sc->sr.rtg, rgbno); in xreap_rgextent_iter() 987 trace_xreap_dispose_unmap_extent(rtg_group(sc->sr.rtg), rgbno, in xreap_rgextent_iter() 995 trace_xreap_dispose_free_extent(rtg_group(sc->sr.rtg), rgbno, *rglenp); in xreap_rgextent_iter() 1101 ASSERT(!sc->sr.rtg); in xreap_rtmeta_extent() 1107 sc->sr.rtg = xfs_rtgroup_get(sc->mp, xfs_rtb_to_rgno(sc->mp, rtbno)); in xreap_rtmeta_extent() 1108 if (!sc->sr.rtg) in xreap_rtmeta_extent() 1111 xfs_rtgroup_lock(sc->sr.rtg, XREAP_RTGLOCK_ALL); in xreap_rtmeta_extent() 1142 xfs_rtgroup_unlock(sc->sr.rtg, XREAP_RTGLOCK_ALL); in xreap_rtmeta_extent() [all …]
|
| H A D | repair.c | 1023 ASSERT(sr->rtg != NULL); in xrep_rtgroup_btcur_init() 1028 sr->rmap_cur = xfs_rtrmapbt_init_cursor(sc->tp, sr->rtg); in xrep_rtgroup_btcur_init() 1033 sr->refc_cur = xfs_rtrefcountbt_init_cursor(sc->tp, sr->rtg); in xrep_rtgroup_btcur_init() 1043 struct xfs_rtgroup *rtg, in xrep_rtgroup_init() argument 1047 ASSERT(sr->rtg == NULL); in xrep_rtgroup_init() 1049 xfs_rtgroup_lock(rtg, rtglock_flags); in xrep_rtgroup_init() 1053 sr->rtg = xfs_rtgroup_hold(rtg); in xrep_rtgroup_init() 1072 if (!xfs_zone_rgbno_is_valid(sc->sr.rtg, rgbno + len - 1)) in xrep_require_rtext_inuse() 1080 error = xfs_rtalloc_extent_is_free(sc->sr.rtg, sc->tp, startrtx, in xrep_require_rtext_inuse()
|
| H A D | metapath.c | 145 struct xfs_rtgroup *rtg; in xchk_setup_metapath_rtginode() local 149 rtg = xfs_rtgroup_get(sc->mp, sc->sm->sm_agno); in xchk_setup_metapath_rtginode() 150 if (!rtg) in xchk_setup_metapath_rtginode() 153 ip = rtg->rtg_inodes[type]; in xchk_setup_metapath_rtginode() 160 xfs_rtginode_path(rtg_rgno(rtg), type), ip); in xchk_setup_metapath_rtginode() 163 xfs_rtgroup_put(rtg); in xchk_setup_metapath_rtginode()
|