/fs/xfs/libxfs/ |
D | xfs_ag_resv.c | 70 struct xfs_perag *pag, in xfs_ag_resv_critical() argument 78 avail = pag->pagf_freeblks - pag->pag_rmapbt_resv.ar_reserved; in xfs_ag_resv_critical() 79 orig = pag->pag_meta_resv.ar_asked; in xfs_ag_resv_critical() 82 avail = pag->pagf_freeblks + pag->pagf_flcount - in xfs_ag_resv_critical() 83 pag->pag_meta_resv.ar_reserved; in xfs_ag_resv_critical() 84 orig = pag->pag_rmapbt_resv.ar_asked; in xfs_ag_resv_critical() 91 trace_xfs_ag_resv_critical(pag, type, avail); in xfs_ag_resv_critical() 95 pag->pag_mount, XFS_ERRTAG_AG_RESV_CRITICAL); in xfs_ag_resv_critical() 104 struct xfs_perag *pag, in xfs_ag_resv_needed() argument 109 len = pag->pag_meta_resv.ar_reserved + pag->pag_rmapbt_resv.ar_reserved; in xfs_ag_resv_needed() [all …]
|
D | xfs_ag_resv.h | 9 int 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, 32 struct xfs_perag *pag; in xfs_ag_resv_rmapbt_alloc() local 35 pag = xfs_perag_get(mp, agno); in xfs_ag_resv_rmapbt_alloc() 36 xfs_ag_resv_alloc_extent(pag, XFS_AG_RESV_RMAPBT, &args); in xfs_ag_resv_rmapbt_alloc() 37 xfs_perag_put(pag); in xfs_ag_resv_rmapbt_alloc()
|
D | xfs_alloc.c | 415 ASSERT(args->pag->pagf_freeblks + args->pag->pagf_flcount >= in xfs_alloc_fix_len() 1186 xfs_ag_resv_alloc_extent(args->pag, args->resv, args); in xfs_alloc_ag_vextent() 1633 xfs_extent_busy_flush(args->mp, args->pag, in xfs_alloc_ag_vextent_near() 1741 args->pag, busy_gen); in xfs_alloc_ag_vextent_size() 1825 xfs_extent_busy_flush(args->mp, args->pag, busy_gen); in xfs_alloc_ag_vextent_size() 2212 struct xfs_perag *pag, in xfs_alloc_longest_free_extent() argument 2222 if (need > pag->pagf_flcount) in xfs_alloc_longest_free_extent() 2223 delta = need - pag->pagf_flcount; in xfs_alloc_longest_free_extent() 2230 if (pag->pagf_freeblks - pag->pagf_longest < reserved) in xfs_alloc_longest_free_extent() 2231 delta += reserved - (pag->pagf_freeblks - pag->pagf_longest); in xfs_alloc_longest_free_extent() [all …]
|
D | xfs_health.h | 112 void xfs_ag_mark_sick(struct xfs_perag *pag, unsigned int mask); 113 void xfs_ag_mark_healthy(struct xfs_perag *pag, unsigned int mask); 114 void xfs_ag_measure_sickness(struct xfs_perag *pag, unsigned int *sick, 145 xfs_ag_has_sickness(struct xfs_perag *pag, unsigned int mask) in xfs_ag_has_sickness() argument 149 xfs_ag_measure_sickness(pag, &sick, &checked); in xfs_ag_has_sickness() 175 xfs_ag_is_healthy(struct xfs_perag *pag) in xfs_ag_is_healthy() argument 177 return !xfs_ag_has_sickness(pag, -1U); in xfs_ag_is_healthy() 187 void xfs_ag_geom_health(struct xfs_perag *pag, struct xfs_ag_geometry *ageo);
|
D | xfs_ialloc.c | 629 struct xfs_perag *pag; in xfs_ialloc_ag_alloc() local 891 pag = agbp->b_pag; in xfs_ialloc_ag_alloc() 892 pag->pagi_freecount += newlen; in xfs_ialloc_ag_alloc() 893 pag->pagi_count += newlen; in xfs_ialloc_ag_alloc() 942 xfs_perag_t *pag; /* per allocation group data */ in xfs_ialloc_ag_select() local 973 pag = xfs_perag_get(mp, agno); in xfs_ialloc_ag_select() 974 if (!pag->pagi_inodeok) { in xfs_ialloc_ag_select() 979 if (!pag->pagi_init) { in xfs_ialloc_ag_select() 985 if (pag->pagi_freecount) { in xfs_ialloc_ag_select() 986 xfs_perag_put(pag); in xfs_ialloc_ag_select() [all …]
|
D | xfs_sb.c | 43 struct xfs_perag *pag; in xfs_perag_get() local 47 pag = radix_tree_lookup(&mp->m_perag_tree, agno); in xfs_perag_get() 48 if (pag) { in xfs_perag_get() 49 ASSERT(atomic_read(&pag->pag_ref) >= 0); in xfs_perag_get() 50 ref = atomic_inc_return(&pag->pag_ref); in xfs_perag_get() 54 return pag; in xfs_perag_get() 66 struct xfs_perag *pag; in xfs_perag_get_tag() local 72 (void **)&pag, first, 1, tag); in xfs_perag_get_tag() 77 ref = atomic_inc_return(&pag->pag_ref); in xfs_perag_get_tag() 79 trace_xfs_perag_get_tag(mp, pag->pag_agno, ref, _RET_IP_); in xfs_perag_get_tag() [all …]
|
D | xfs_alloc_btree.c | 42 struct xfs_perag *pag = agbp->b_pag; in xfs_allocbt_set_root() local 48 pag->pagf_levels[btnum] += inc; in xfs_allocbt_set_root() 116 struct xfs_perag *pag; in xfs_allocbt_update_lastrec() local 160 pag = cur->bc_ag.agbp->b_pag; in xfs_allocbt_update_lastrec() 161 pag->pagf_longest = be32_to_cpu(len); in xfs_allocbt_update_lastrec() 293 struct xfs_perag *pag = bp->b_pag; in xfs_allocbt_verify() local 319 if (pag && pag->pagf_init) { in xfs_allocbt_verify() 320 if (level >= pag->pagf_levels[btnum]) in xfs_allocbt_verify()
|
D | xfs_rmap_btree.c | 67 struct xfs_perag *pag = agbp->b_pag; in xfs_rmapbt_set_root() local 73 pag->pagf_levels[btnum] += inc; in xfs_rmapbt_set_root() 124 struct xfs_perag *pag; in xfs_rmapbt_free_block() local 141 pag = cur->bc_ag.agbp->b_pag; in xfs_rmapbt_free_block() 142 xfs_ag_resv_free_extent(pag, XFS_AG_RESV_RMAPBT, NULL, 1); in xfs_rmapbt_free_block() 293 struct xfs_perag *pag = bp->b_pag; in xfs_rmapbt_verify() local 319 if (pag && pag->pagf_init) { in xfs_rmapbt_verify() 320 if (level >= pag->pagf_levels[XFS_BTNUM_RMAPi]) in xfs_rmapbt_verify()
|
D | xfs_refcount_btree.c | 40 struct xfs_perag *pag = agbp->b_pag; in xfs_refcountbt_set_root() local 46 pag->pagf_refcount_level += inc; in xfs_refcountbt_set_root() 205 struct xfs_perag *pag = bp->b_pag; in xfs_refcountbt_verify() local 219 if (pag && pag->pagf_init) { in xfs_refcountbt_verify() 220 if (level >= pag->pagf_refcount_level) in xfs_refcountbt_verify()
|
D | xfs_ag.c | 557 struct xfs_perag *pag; in xfs_ag_get_geometry() local 572 pag = agi_bp->b_pag; in xfs_ag_get_geometry() 584 freeblks = pag->pagf_freeblks + in xfs_ag_get_geometry() 585 pag->pagf_flcount + in xfs_ag_get_geometry() 586 pag->pagf_btreeblks - in xfs_ag_get_geometry() 587 xfs_ag_resv_needed(pag, XFS_AG_RESV_NONE); in xfs_ag_get_geometry() 589 xfs_ag_geom_health(pag, ageo); in xfs_ag_get_geometry()
|
/fs/xfs/ |
D | xfs_extent_busy.c | 32 struct xfs_perag *pag; in xfs_extent_busy_insert() local 46 pag = xfs_perag_get(tp->t_mountp, new->agno); in xfs_extent_busy_insert() 47 spin_lock(&pag->pagb_lock); in xfs_extent_busy_insert() 48 rbp = &pag->pagb_tree.rb_node; in xfs_extent_busy_insert() 65 rb_insert_color(&new->rb_node, &pag->pagb_tree); in xfs_extent_busy_insert() 68 spin_unlock(&pag->pagb_lock); in xfs_extent_busy_insert() 69 xfs_perag_put(pag); in xfs_extent_busy_insert() 88 struct xfs_perag *pag; in xfs_extent_busy_search() local 93 pag = xfs_perag_get(mp, agno); in xfs_extent_busy_search() 94 spin_lock(&pag->pagb_lock); in xfs_extent_busy_search() [all …]
|
D | xfs_icache.c | 161 struct xfs_perag *pag) in xfs_perag_set_reclaim_tag() argument 163 struct xfs_mount *mp = pag->pag_mount; in xfs_perag_set_reclaim_tag() 165 lockdep_assert_held(&pag->pag_ici_lock); in xfs_perag_set_reclaim_tag() 166 if (pag->pag_ici_reclaimable++) in xfs_perag_set_reclaim_tag() 171 radix_tree_tag_set(&mp->m_perag_tree, pag->pag_agno, in xfs_perag_set_reclaim_tag() 178 trace_xfs_perag_set_reclaim(mp, pag->pag_agno, -1, _RET_IP_); in xfs_perag_set_reclaim_tag() 183 struct xfs_perag *pag) in xfs_perag_clear_reclaim_tag() argument 185 struct xfs_mount *mp = pag->pag_mount; in xfs_perag_clear_reclaim_tag() 187 lockdep_assert_held(&pag->pag_ici_lock); in xfs_perag_clear_reclaim_tag() 188 if (--pag->pag_ici_reclaimable) in xfs_perag_clear_reclaim_tag() [all …]
|
D | xfs_filestream.c | 43 struct xfs_perag *pag; in xfs_filestream_peek_ag() local 46 pag = xfs_perag_get(mp, agno); in xfs_filestream_peek_ag() 47 ret = atomic_read(&pag->pagf_fstrms); in xfs_filestream_peek_ag() 48 xfs_perag_put(pag); in xfs_filestream_peek_ag() 57 struct xfs_perag *pag; in xfs_filestream_get_ag() local 60 pag = xfs_perag_get(mp, agno); in xfs_filestream_get_ag() 61 ret = atomic_inc_return(&pag->pagf_fstrms); in xfs_filestream_get_ag() 62 xfs_perag_put(pag); in xfs_filestream_get_ag() 71 struct xfs_perag *pag; in xfs_filestream_put_ag() local 73 pag = xfs_perag_get(mp, agno); in xfs_filestream_put_ag() [all …]
|
D | xfs_health.c | 27 struct xfs_perag *pag; in xfs_health_unmount() local 38 pag = xfs_perag_get(mp, agno); in xfs_health_unmount() 39 xfs_ag_measure_sickness(pag, &sick, &checked); in xfs_health_unmount() 44 xfs_perag_put(pag); in xfs_health_unmount() 181 struct xfs_perag *pag, in xfs_ag_mark_sick() argument 185 trace_xfs_ag_mark_sick(pag->pag_mount, pag->pag_agno, mask); in xfs_ag_mark_sick() 187 spin_lock(&pag->pag_state_lock); in xfs_ag_mark_sick() 188 pag->pag_sick |= mask; in xfs_ag_mark_sick() 189 pag->pag_checked |= mask; in xfs_ag_mark_sick() 190 spin_unlock(&pag->pag_state_lock); in xfs_ag_mark_sick() [all …]
|
D | xfs_mount.c | 127 struct xfs_perag *pag = container_of(head, struct xfs_perag, rcu_head); in __xfs_free_perag() local 129 kmem_free(pag); in __xfs_free_perag() 140 struct xfs_perag *pag; in xfs_free_perag() local 144 pag = radix_tree_delete(&mp->m_perag_tree, agno); in xfs_free_perag() 146 ASSERT(pag); in xfs_free_perag() 147 XFS_IS_CORRUPT(pag->pag_mount, atomic_read(&pag->pag_ref) != 0); in xfs_free_perag() 148 xfs_iunlink_destroy(pag); in xfs_free_perag() 149 xfs_buf_hash_destroy(pag); in xfs_free_perag() 150 call_rcu(&pag->rcu_head, __xfs_free_perag); in xfs_free_perag() 180 xfs_perag_t *pag; in xfs_initialize_perag() local [all …]
|
D | xfs_fsops.c | 147 struct xfs_perag *pag; in xfs_growfs_data_private() local 149 pag = xfs_perag_get(mp, id.agno); in xfs_growfs_data_private() 150 error = xfs_ag_resv_free(pag); in xfs_growfs_data_private() 151 xfs_perag_put(pag); in xfs_growfs_data_private() 511 struct xfs_perag *pag; in xfs_fs_reserve_ag_blocks() local 517 pag = xfs_perag_get(mp, agno); in xfs_fs_reserve_ag_blocks() 518 err2 = xfs_ag_resv_init(pag, NULL); in xfs_fs_reserve_ag_blocks() 519 xfs_perag_put(pag); in xfs_fs_reserve_ag_blocks() 541 struct xfs_perag *pag; in xfs_fs_unreserve_ag_blocks() local 546 pag = xfs_perag_get(mp, agno); in xfs_fs_unreserve_ag_blocks() [all …]
|
D | xfs_buf.c | 552 struct xfs_perag *pag) in xfs_buf_hash_init() argument 554 spin_lock_init(&pag->pag_buf_lock); in xfs_buf_hash_init() 555 return rhashtable_init(&pag->pag_buf_hash, &xfs_buf_hash_params); in xfs_buf_hash_init() 560 struct xfs_perag *pag) in xfs_buf_hash_destroy() argument 562 rhashtable_destroy(&pag->pag_buf_hash); in xfs_buf_hash_destroy() 592 struct xfs_perag *pag; in xfs_buf_find() local 620 pag = xfs_perag_get(btp->bt_mount, in xfs_buf_find() 623 spin_lock(&pag->pag_buf_lock); in xfs_buf_find() 624 bp = rhashtable_lookup_fast(&pag->pag_buf_hash, &cmap, in xfs_buf_find() 634 spin_unlock(&pag->pag_buf_lock); in xfs_buf_find() [all …]
|
D | xfs_mount.h | 385 struct xfs_perag *pag, in xfs_perag_resv() argument 390 return &pag->pag_meta_resv; in xfs_perag_resv() 392 return &pag->pag_rmapbt_resv; in xfs_perag_resv() 398 int xfs_buf_hash_init(xfs_perag_t *pag); 399 void xfs_buf_hash_destroy(xfs_perag_t *pag);
|
D | xfs_discard.c | 35 struct xfs_perag *pag; in xfs_trim_extents() local 39 pag = xfs_perag_get(mp, agno); in xfs_trim_extents() 137 xfs_perag_put(pag); in xfs_trim_extents()
|
/fs/xfs/scrub/ |
D | fscounters.c | 69 struct xfs_perag *pag = NULL; in xchk_fscount_warmup() local 74 pag = xfs_perag_get(mp, agno); in xchk_fscount_warmup() 76 if (pag->pagi_init && pag->pagf_init) in xchk_fscount_warmup() 92 if (!pag->pagi_init || !pag->pagf_init) in xchk_fscount_warmup() 100 xfs_perag_put(pag); in xchk_fscount_warmup() 101 pag = NULL; in xchk_fscount_warmup() 112 if (pag) in xchk_fscount_warmup() 113 xfs_perag_put(pag); in xchk_fscount_warmup() 159 struct xfs_perag *pag; in xchk_fscount_aggregate_agcounts() local 171 pag = xfs_perag_get(mp, agno); in xchk_fscount_aggregate_agcounts() [all …]
|
D | agheader_repair.c | 199 ASSERT(sc->sa.pag->pagf_init); in xrep_agf_init_header() 200 sc->sa.pag->pagf_init = 0; in xrep_agf_init_header() 304 struct xfs_perag *pag; in xrep_agf_commit_new() local 315 pag = sc->sa.pag; in xrep_agf_commit_new() 316 pag->pagf_btreeblks = be32_to_cpu(agf->agf_btreeblks); in xrep_agf_commit_new() 317 pag->pagf_freeblks = be32_to_cpu(agf->agf_freeblks); in xrep_agf_commit_new() 318 pag->pagf_longest = be32_to_cpu(agf->agf_longest); in xrep_agf_commit_new() 319 pag->pagf_levels[XFS_BTNUM_BNOi] = in xrep_agf_commit_new() 321 pag->pagf_levels[XFS_BTNUM_CNTi] = in xrep_agf_commit_new() 323 pag->pagf_levels[XFS_BTNUM_RMAPi] = in xrep_agf_commit_new() [all …]
|
D | health.c | 130 struct xfs_perag *pag; in xchk_update_health() local 139 pag = xfs_perag_get(sc->mp, sc->sm->sm_agno); in xchk_update_health() 141 xfs_ag_mark_sick(pag, sc->sick_mask); in xchk_update_health() 143 xfs_ag_mark_healthy(pag, sc->sick_mask); in xchk_update_health() 144 xfs_perag_put(pag); in xchk_update_health() 176 struct xfs_perag *pag, in xchk_ag_btree_healthy_enough() argument 224 if (xfs_ag_has_sickness(pag, mask)) { in xchk_ag_btree_healthy_enough()
|
D | repair.c | 160 struct xfs_perag *pag, in xrep_ag_has_space() argument 164 return !xfs_ag_resv_critical(pag, XFS_AG_RESV_RMAPBT) && in xrep_ag_has_space() 165 !xfs_ag_resv_critical(pag, XFS_AG_RESV_METADATA) && in xrep_ag_has_space() 166 pag->pagf_freeblks > xfs_ag_resv_needed(pag, type) + nr_blocks; in xrep_ag_has_space() 180 struct xfs_perag *pag; in xrep_calc_ag_resblks() local 195 pag = xfs_perag_get(mp, sm->sm_agno); in xrep_calc_ag_resblks() 196 if (pag->pagi_init) { in xrep_calc_ag_resblks() 198 icount = pag->pagi_count; in xrep_calc_ag_resblks() 203 icount = pag->pagi_count; in xrep_calc_ag_resblks() 218 xfs_perag_put(pag); in xrep_calc_ag_resblks() [all …]
|
D | common.c | 465 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_BNO)) { in xchk_ag_btcur_init() 474 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_CNT)) { in xchk_ag_btcur_init() 484 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_INO)) { in xchk_ag_btcur_init() 493 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_FINO)) { in xchk_ag_btcur_init() 502 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_RMAP)) { in xchk_ag_btcur_init() 511 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_REFC)) { in xchk_ag_btcur_init() 542 if (sa->pag) { in xchk_ag_free() 543 xfs_perag_put(sa->pag); in xchk_ag_free() 544 sa->pag = NULL; in xchk_ag_free() 582 if (!sa->pag) in xchk_perag_get() [all …]
|
D | agheader.c | 510 struct xfs_perag *pag; in xchk_agf() local 584 pag = xfs_perag_get(mp, agno); in xchk_agf() 585 if (pag->pagf_freeblks != be32_to_cpu(agf->agf_freeblks)) in xchk_agf() 587 if (pag->pagf_flcount != be32_to_cpu(agf->agf_flcount)) in xchk_agf() 589 if (pag->pagf_btreeblks != be32_to_cpu(agf->agf_btreeblks)) in xchk_agf() 591 xfs_perag_put(pag); in xchk_agf() 848 struct xfs_perag *pag; in xchk_agi() local 920 pag = xfs_perag_get(mp, agno); in xchk_agi() 921 if (pag->pagi_count != be32_to_cpu(agi->agi_count)) in xchk_agi() 923 if (pag->pagi_freecount != be32_to_cpu(agi->agi_freecount)) in xchk_agi() [all …]
|