| /linux/fs/xfs/libxfs/ |
| H A D | xfs_ag.h | 98 static inline struct xfs_group *pag_group(struct xfs_perag *pag) in pag_group() argument 100 return &pag->pag_group; in pag_group() 103 static inline struct xfs_mount *pag_mount(const struct xfs_perag *pag) in pag_mount() argument 105 return pag->pag_group.xg_mount; in pag_mount() 108 static inline xfs_agnumber_t pag_agno(const struct xfs_perag *pag) in pag_agno() argument 110 return pag->pag_group.xg_gno; in pag_agno() 123 static inline bool xfs_perag_ ## name (struct xfs_perag *pag) \ 125 return test_bit(XFS_AGSTATE_ ## NAME, &pag->pag_opstate); \ 153 struct xfs_perag *pag) in xfs_perag_hold() argument 155 return to_perag(xfs_group_hold(pag_group(pag))); in xfs_perag_hold() [all …]
|
| H A D | xfs_ag_resv.h | 9 void xfs_ag_resv_free(struct xfs_perag *pag); 10 int xfs_ag_resv_init(struct xfs_perag *pag, struct xfs_trans *tp); 12 bool xfs_ag_resv_critical(struct xfs_perag *pag, enum xfs_ag_resv_type type); 13 xfs_extlen_t xfs_ag_resv_needed(struct xfs_perag *pag, 16 void xfs_ag_resv_alloc_extent(struct xfs_perag *pag, enum xfs_ag_resv_type type, 18 void xfs_ag_resv_free_extent(struct xfs_perag *pag, enum xfs_ag_resv_type type, 23 struct xfs_perag *pag, in xfs_perag_resv() argument 28 return &pag->pag_meta_resv; in xfs_perag_resv() 30 return &pag->pag_rmapbt_resv; in xfs_perag_resv()
|
| H A D | xfs_alloc.c | 253 struct xfs_perag *pag, in xfs_alloc_check_irec() argument 260 if (!xfs_verify_agbext(pag, irec->ar_startblock, irec->ar_blockcount)) in xfs_alloc_check_irec() 332 busy = xfs_extent_busy_trim(pag_group(args->pag), args->minlen, in xfs_alloc_compute_aligned() 463 ASSERT(args->pag->pagf_freeblks + args->pag->pagf_flcount >= in xfs_alloc_fix_len() 541 struct xfs_perag *pag = to_perag(cnt_cur->bc_group); in xfs_alloc_fixup_longest() local 552 pag->pagf_longest = longest; in xfs_alloc_fixup_longest() 553 agf->agf_longest = cpu_to_be32(pag->pagf_longest); in xfs_alloc_fixup_longest() 877 struct xfs_perag *pag, in xfs_alloc_read_agfl() argument 881 struct xfs_mount *mp = pag_mount(pag); in xfs_alloc_read_agfl() 886 XFS_AG_DADDR(mp, pag_agno(pag), XFS_AGFL_DADDR(mp)), in xfs_alloc_read_agfl() [all …]
|
| H A D | xfs_alloc.h | 38 struct xfs_perag *pag; /* per-ag struct for this agno */ member 72 xfs_extlen_t xfs_alloc_longest_free_extent(struct xfs_perag *pag, 75 struct xfs_perag *pag); 76 int xfs_alloc_get_freelist(struct xfs_perag *pag, struct xfs_trans *tp, 78 int xfs_alloc_put_freelist(struct xfs_perag *pag, struct xfs_trans *tp, 146 struct xfs_perag *pag, 156 struct xfs_perag *pag, in xfs_free_extent() argument 162 return __xfs_free_extent(tp, pag, agbno, len, oinfo, type, false); in xfs_free_extent() 189 xfs_failaddr_t xfs_alloc_check_irec(struct xfs_perag *pag, 192 int xfs_read_agf(struct xfs_perag *pag, struct xfs_trans *tp, int flags, [all …]
|
| H A D | xfs_ialloc.h | 45 int xfs_difree(struct xfs_trans *tp, struct xfs_perag *pag, 53 struct xfs_perag *pag, 68 int xfs_read_agi(struct xfs_perag *pag, struct xfs_trans *tp, xfs_buf_flags_t flags, 70 int xfs_ialloc_read_agi(struct xfs_perag *pag, struct xfs_trans *tp, 100 xfs_failaddr_t xfs_inobt_check_irec(struct xfs_perag *pag, 115 int xfs_ialloc_check_shrink(struct xfs_perag *pag, struct xfs_trans *tp,
|
| H A D | xfs_rmap_btree.h | 47 struct xfs_perag *pag); 60 struct xfs_perag *pag, xfs_extlen_t *ask, xfs_extlen_t *used); 67 struct xfs_btree_cur *xfs_rmapbt_mem_cursor(struct xfs_perag *pag,
|
| /linux/fs/xfs/ |
| H A D | xfs_icache.c | 53 static int xfs_icwalk_ag(struct xfs_perag *pag, 220 struct xfs_perag *pag) in xfs_blockgc_queue() argument 222 struct xfs_mount *mp = pag_mount(pag); in xfs_blockgc_queue() 228 if (radix_tree_tagged(&pag->pag_ici_root, XFS_ICI_BLOCKGC_TAG)) in xfs_blockgc_queue() 229 queue_delayed_work(mp->m_blockgc_wq, &pag->pag_blockgc_work, in xfs_blockgc_queue() 237 struct xfs_perag *pag, in xfs_perag_set_inode_tag() argument 243 lockdep_assert_held(&pag->pag_ici_lock); in xfs_perag_set_inode_tag() 245 was_tagged = radix_tree_tagged(&pag->pag_ici_root, tag); in xfs_perag_set_inode_tag() 246 radix_tree_tag_set(&pag->pag_ici_root, agino, tag); in xfs_perag_set_inode_tag() 249 pag->pag_ici_reclaimable++; in xfs_perag_set_inode_tag() [all …]
|
| H A D | xfs_iwalk.c | 56 struct xfs_perag *pag; member 99 struct xfs_perag *pag, in xfs_iwalk_ichunk_ra() argument 116 xfs_agbno_to_daddr(pag, agbno), in xfs_iwalk_ichunk_ra() 178 struct xfs_perag *pag = iwag->pag; in xfs_iwalk_ag_recs() local 185 trace_xfs_iwalk_ag_rec(pag, irec); in xfs_iwalk_ag_recs() 191 error = iwag->inobt_walk_fn(mp, tp, pag_agno(pag), irec, in xfs_iwalk_ag_recs() 210 xfs_agino_to_ino(pag, in xfs_iwalk_ag_recs() 264 struct xfs_perag *pag = iwag->pag; in xfs_iwalk_ag_start() local 270 error = xfs_ialloc_read_agi(pag, tp, 0, agi_bpp); in xfs_iwalk_ag_start() 273 *curpp = xfs_inobt_init_cursor(pag, tp, *agi_bpp); in xfs_iwalk_ag_start() [all …]
|
| H A D | xfs_discard.c | 162 struct xfs_perag *pag, in xfs_trim_gather_extents() argument 166 struct xfs_mount *mp = pag_mount(pag); in xfs_trim_gather_extents() 183 error = xfs_alloc_read_agf(pag, tp, 0, &agbp); in xfs_trim_gather_extents() 193 tcur->count = pag->pagf_longest; in xfs_trim_gather_extents() 197 cur = xfs_bnobt_init_cursor(mp, tp, agbp, pag); in xfs_trim_gather_extents() 203 cur = xfs_cntbt_init_cursor(mp, tp, agbp, pag); in xfs_trim_gather_extents() 207 cur = xfs_cntbt_init_cursor(mp, tp, agbp, pag); in xfs_trim_gather_extents() 251 trace_xfs_discard_exclude(pag_group(pag), fbno, flen); in xfs_trim_gather_extents() 255 trace_xfs_discard_exclude(pag_group(pag), fbno, flen); in xfs_trim_gather_extents() 273 trace_xfs_discard_toosmall(pag_group(pag), fbno, flen); in xfs_trim_gather_extents() [all …]
|
| H A D | xfs_inode.c | 1347 struct xfs_perag *pag; in xfs_inactive_health() local 1360 pag = xfs_perag_get(mp, XFS_INODE_TO_AGNO(ip)); in xfs_inactive_health() 1361 if (!pag) { in xfs_inactive_health() 1367 xfs_ag_mark_sick(pag, XFS_SICK_AG_INODES); in xfs_inactive_health() 1368 xfs_perag_put(pag); in xfs_inactive_health() 1512 struct xfs_perag *pag, in xfs_iunlink_lookup() argument 1518 ip = radix_tree_lookup(&pag->pag_ici_root, agino); in xfs_iunlink_lookup() 1550 struct xfs_perag *pag = agibp->b_pag; in xfs_iunlink_reload_next() local 1551 struct xfs_mount *mp = pag_mount(pag); in xfs_iunlink_reload_next() 1559 next_ip = radix_tree_lookup(&pag->pag_ici_root, next_agino); in xfs_iunlink_reload_next() [all …]
|
| H A D | xfs_health.c | 50 struct xfs_perag *pag = NULL; in xfs_health_unmount() local 60 while ((pag = xfs_perag_next(mp, pag))) in xfs_health_unmount() 61 xfs_health_unmount_group(pag_group(pag), &warn); in xfs_health_unmount() 193 struct xfs_perag *pag = xfs_perag_get(mp, agno); in xfs_agno_mark_sick() local 196 if (!pag) in xfs_agno_mark_sick() 199 xfs_ag_mark_sick(pag, mask); in xfs_agno_mark_sick() 200 xfs_perag_put(pag); in xfs_agno_mark_sick() 533 struct xfs_perag *pag, in xfs_ag_geom_health() argument 543 xfs_group_measure_sickness(pag_group(pag), &sick, &checked); in xfs_ag_geom_health()
|
| H A D | xfs_iunlink_item.h | 17 struct xfs_perag *pag; member 25 struct xfs_perag *pag, xfs_agino_t next_agino);
|
| H A D | xfs_reflink.c | 145 struct xfs_perag *pag; in xfs_reflink_find_shared() local 150 pag = xfs_perag_get(mp, XFS_FSB_TO_AGNO(mp, irec->br_startblock)); in xfs_reflink_find_shared() 153 error = xfs_alloc_read_agf(pag, tp, 0, &agbp); in xfs_reflink_find_shared() 157 cur = xfs_refcountbt_init_cursor(mp, tp, agbp, pag); in xfs_reflink_find_shared() 166 xfs_perag_put(pag); in xfs_reflink_find_shared() 1105 struct xfs_perag *pag = NULL; in xfs_reflink_recover_cow() local 1112 while ((pag = xfs_perag_next(mp, pag))) { in xfs_reflink_recover_cow() 1113 error = xfs_refcount_recover_cow_leftovers(pag_group(pag)); in xfs_reflink_recover_cow() 1115 xfs_perag_rele(pag); in xfs_reflink_recover_cow() 1323 struct xfs_perag *pag; in xfs_reflink_ag_has_free_space() local [all …]
|
| /linux/fs/xfs/scrub/ |
| H A D | agheader_repair.c | 120 if (!xfs_verify_agbno(sc->sa.pag, agbno)) in xrep_agf_check_agfl_block() 144 return xfs_verify_agbno(sc->sa.pag, fab->root) && in xrep_check_btree_root() 204 struct xfs_perag *pag = sc->sa.pag; in xrep_agf_init_header() local 211 agf->agf_seqno = cpu_to_be32(pag_agno(pag)); in xrep_agf_init_header() 212 agf->agf_length = cpu_to_be32(pag_group(pag)->xg_block_count); in xrep_agf_init_header() 220 ASSERT(xfs_perag_initialised_agf(pag)); in xrep_agf_init_header() 221 clear_bit(XFS_AGSTATE_AGF_INIT, &pag->pag_opstate); in xrep_agf_init_header() 263 cur = xfs_bnobt_init_cursor(mp, sc->tp, agf_bp, sc->sa.pag); in xrep_agf_calc_from_btrees() 276 cur = xfs_cntbt_init_cursor(mp, sc->tp, agf_bp, sc->sa.pag); in xrep_agf_calc_from_btrees() 284 cur = xfs_rmapbt_init_cursor(mp, sc->tp, agf_bp, sc->sa.pag); in xrep_agf_calc_from_btrees() [all …]
|
| H A D | fscounters.c | 77 struct xfs_perag *pag = NULL; in xchk_fscount_warmup() local 80 while ((pag = xfs_perag_next(mp, pag))) { in xchk_fscount_warmup() 83 if (xfs_perag_initialised_agi(pag) && in xchk_fscount_warmup() 84 xfs_perag_initialised_agf(pag)) in xchk_fscount_warmup() 88 error = xfs_ialloc_read_agi(pag, sc->tp, 0, &agi_bp); in xchk_fscount_warmup() 91 error = xfs_alloc_read_agf(pag, sc->tp, 0, &agf_bp); in xchk_fscount_warmup() 99 if (!xfs_perag_initialised_agi(pag) || in xchk_fscount_warmup() 100 !xfs_perag_initialised_agf(pag)) { in xchk_fscount_warmup() 115 if (pag) in xchk_fscount_warmup() 116 xfs_perag_rele(pag); in xchk_fscount_warmup() [all …]
|
| H A D | repair.c | 266 struct xfs_perag *pag, in xrep_ag_has_space() argument 270 return !xfs_ag_resv_critical(pag, XFS_AG_RESV_RMAPBT) && in xrep_ag_has_space() 271 !xfs_ag_resv_critical(pag, XFS_AG_RESV_METADATA) && in xrep_ag_has_space() 272 pag->pagf_freeblks > xfs_ag_resv_needed(pag, type) + nr_blocks; in xrep_ag_has_space() 286 struct xfs_perag *pag; in xrep_calc_ag_resblks() local 301 pag = xfs_perag_get(mp, sm->sm_agno); in xrep_calc_ag_resblks() 302 if (xfs_perag_initialised_agi(pag)) { in xrep_calc_ag_resblks() 304 icount = pag->pagi_count; in xrep_calc_ag_resblks() 307 error = xfs_ialloc_read_agi(pag, NULL, 0, &bp); in xrep_calc_ag_resblks() 309 icount = pag->pagi_count; in xrep_calc_ag_resblks() [all …]
|
| H A D | newbt.c | 71 free = sc->sa.pag->pagf_freeblks; in xrep_newbt_estimate_slack() 72 sz = xfs_ag_block_count(sc->mp, pag_agno(sc->sa.pag)); in xrep_newbt_estimate_slack() 189 struct xfs_perag *pag, in xrep_newbt_add_blocks() argument 206 resv->pag = xfs_perag_hold(pag); in xrep_newbt_add_blocks() 220 xfs_perag_put(resv->pag); in xrep_newbt_add_blocks() 233 struct xfs_perag *pag, in xrep_newbt_add_extent() argument 240 .fsbno = xfs_agbno_to_fsb(pag, agbno), in xrep_newbt_add_extent() 245 return xrep_newbt_add_blocks(xnr, pag, &args); in xrep_newbt_add_extent() 256 if (agno == pag_agno(sc->sa.pag) && in xrep_newbt_validate_ag_alloc_hint() 261 xfs_agbno_to_fsb(sc->sa.pag, XFS_AGFL_BLOCK(sc->mp) + 1); in xrep_newbt_validate_ag_alloc_hint() [all …]
|
| H A D | alloc_repair.c | 135 struct xfs_group *xg = pag_group(sc->sa.pag); in xrep_setup_ag_allocbt() 156 if (xfs_alloc_check_irec(sc->sa.pag, rec) != NULL) in xrep_abt_check_free_ext() 212 trace_xrep_abt_found(sc->sa.pag, &arec); in xrep_abt_stash() 392 error = xfs_alloc_read_agfl(sc->sa.pag, sc->tp, &agfl_bp); in xrep_abt_find_freespace() 486 trace_xrep_newbt_alloc_ag_blocks(sc->sa.pag, arec.ar_startblock, in xrep_abt_reserve_space() 489 error = xrep_newbt_add_extent(&ra->new_bnobt, sc->sa.pag, in xrep_abt_reserve_space() 536 struct xfs_perag *pag = sc->sa.pag; in xrep_abt_dispose_one() local 541 ASSERT(pag == resv->pag); in xrep_abt_dispose_one() 546 xfs_agbno_to_fsb(pag, resv->agbno), resv->used, in xrep_abt_dispose_one() 557 trace_xrep_newbt_free_blocks(resv->pag, free_agbno, free_aglen, in xrep_abt_dispose_one() [all …]
|
| H A D | health.c | 170 struct xfs_perag *pag = NULL; in xchk_mark_all_healthy() local 174 while ((pag = xfs_perag_next(mp, pag))) in xchk_mark_all_healthy() 175 xfs_group_mark_healthy(pag_group(pag), XFS_SICK_AG_INDIRECT); in xchk_mark_all_healthy() 194 struct xfs_perag *pag; in xchk_update_health() local 221 pag = xfs_perag_get(sc->mp, sc->sm->sm_agno); in xchk_update_health() 223 xfs_group_mark_corrupt(pag_group(pag), mask); in xchk_update_health() 225 xfs_group_mark_healthy(pag_group(pag), mask); in xchk_update_health() 226 xfs_perag_put(pag); in xchk_update_health() 315 struct xfs_perag *pag = NULL; in xchk_health_record() local 324 while ((pag = xfs_perag_next(mp, pag))) { in xchk_health_record() [all …]
|
| H A D | reap.c | 148 error = xfs_rmap_alloc(sc->tp, sc->sa.agf_bp, sc->sa.pag, agbno, 1, in xreap_put_freelist() 154 error = xfs_alloc_read_agfl(sc->sa.pag, sc->tp, &agfl_bp); in xreap_put_freelist() 158 error = xfs_alloc_put_freelist(sc->sa.pag, sc->tp, sc->sa.agf_bp, in xreap_put_freelist() 162 xfs_extent_busy_insert(sc->tp, pag_group(sc->sa.pag), agbno, 1, in xreap_put_freelist() 290 struct xfs_perag *pag = sc->sa.pag; in xreap_agextent_binval() local 299 if (!xfs_verify_agbno(pag, agbno) || in xreap_agextent_binval() 300 !xfs_verify_agbno(pag, agbno_next - 1)) in xreap_agextent_binval() 312 .daddr = xfs_agbno_to_daddr(pag, bno), in xreap_agextent_binval() 338 trace_xreap_agextent_binval(pag_group(sc->sa.pag), agbno, *aglenp); in xreap_agextent_binval() 366 sc->sa.pag); in xreap_agextent_select() [all …]
|
| H A D | refcount_repair.c | 138 if (xfs_refcount_check_irec(sc->sa.pag, rec) != NULL) in xrep_refc_check_ext() 186 trace_xrep_refc_found(pag_group(sc->sa.pag), &irec); in xrep_refc_stash() 556 struct xfs_perag *pag = sc->sa.pag; in xrep_refc_reset_counters() local 569 pag->pagf_repair_refcount_level = pag->pagf_refcount_level; in xrep_refc_reset_counters() 586 struct xfs_perag *pag = sc->sa.pag; in xrep_refc_build_new_tree() local 600 xfs_agbno_to_fsb(pag, xfs_refc_block(sc->mp)), in xrep_refc_build_new_tree() 606 refc_cur = xfs_refcountbt_init_cursor(sc->mp, NULL, NULL, pag); in xrep_refc_build_new_tree() 630 pag->pagf_repair_refcount_level = rr->new_btree.bload.btree_height; in xrep_refc_build_new_tree() 658 pag->pagf_repair_refcount_level = 0; in xrep_refc_build_new_tree() 675 struct xfs_perag *pag = sc->sa.pag; in xrep_refc_remove_old_tree() local [all …]
|
| H A D | rmap_repair.c | 193 if (xfs_rmap_check_irec(sc->sa.pag, rec) != NULL) in xrep_rmap_check_mapping() 234 trace_xrep_rmap_found(sc->sa.pag, &rmap); in xrep_rmap_stash() 237 mcur = xfs_rmapbt_mem_cursor(sc->sa.pag, sc->tp, &rr->rmap_btree); in xrep_rmap_stash() 347 pag_agno(rf->rr->sc->sa.pag)) in xrep_rmap_visit_bmbt() 394 if (XFS_FSB_TO_AGNO(cur->bc_mp, fsbno) != pag_agno(rf->rr->sc->sa.pag)) in xrep_rmap_visit_iroot_btree_block() 870 if (!xfs_ag_contains_log(sc->mp, pag_agno(sc->sa.pag))) in xrep_rmap_find_log_rmaps() 993 mcur = xfs_rmapbt_mem_cursor(rr->sc->sa.pag, NULL, &rr->rmap_btree); in xrep_rmap_find_rmaps() 995 sc->sa.pag); in xrep_rmap_find_rmaps() 1043 .agno = pag_agno(rr->sc->sa.pag), in xrep_rmap_try_reserve() 1080 sc->sa.pag); in xrep_rmap_try_reserve() [all …]
|
| H A D | agheader.c | 107 struct xfs_perag *pag; in xchk_superblock() local 124 pag = xfs_perag_get(mp, agno); in xchk_superblock() 125 if (!pag) in xchk_superblock() 435 xfs_perag_put(pag); in xchk_superblock() 610 struct xfs_perag *pag; in xchk_agf() local 627 pag = sc->sa.pag; in xchk_agf() 631 if (eoag != pag_group(pag)->xg_block_count) in xchk_agf() 636 if (!xfs_verify_agbno(pag, agbno)) in xchk_agf() 640 if (!xfs_verify_agbno(pag, agbno)) in xchk_agf() 653 if (!xfs_verify_agbno(pag, agbno)) in xchk_agf() [all …]
|
| H A D | trace.h | 787 TP_PROTO(const struct xfs_perag *pag, xfs_agino_t startino, 792 TP_ARGS(pag, startino, map_agblock, map_len, chunk_ino, nr_inodes, 807 __entry->dev = pag_mount(pag)->m_super->s_dev; 808 __entry->agno = pag_agno(pag); 937 TP_PROTO(const struct xfs_perag *pag, 940 TP_ARGS(pag, irec, seen), 951 __entry->dev = pag_mount(pag)->m_super->s_dev; 952 __entry->agno = pag_agno(pag); 2111 TP_PROTO(const struct xfs_perag *pag, const struct xfs_rmap_irec *rec), 2112 TP_ARGS(pag, rec), [all …]
|
| H A D | nlinks_repair.c | 75 struct xfs_perag *pag; in xrep_nlinks_iunlink_remove() local 78 pag = xfs_perag_get(sc->mp, XFS_INODE_TO_AGNO(sc->ip)); in xrep_nlinks_iunlink_remove() 79 error = xfs_iunlink_remove(sc->tp, pag, sc->ip); in xrep_nlinks_iunlink_remove() 80 xfs_perag_put(pag); in xrep_nlinks_iunlink_remove()
|