Lines Matching refs:pag

125 static inline bool xfs_perag_ ## name (struct xfs_perag *pag) \
127 return test_bit(XFS_AGSTATE_ ## NAME, &pag->pag_opstate); \
145 struct xfs_perag *xfs_perag_hold(struct xfs_perag *pag);
146 void xfs_perag_put(struct xfs_perag *pag);
152 void xfs_perag_rele(struct xfs_perag *pag);
162 xfs_verify_agbno(struct xfs_perag *pag, xfs_agblock_t agbno) in xfs_verify_agbno() argument
164 if (agbno >= pag->block_count) in xfs_verify_agbno()
166 if (agbno <= pag->min_block) in xfs_verify_agbno()
173 struct xfs_perag *pag, in xfs_verify_agbext() argument
180 if (!xfs_verify_agbno(pag, agbno)) in xfs_verify_agbext()
183 return xfs_verify_agbno(pag, agbno + len - 1); in xfs_verify_agbext()
191 xfs_verify_agino(struct xfs_perag *pag, xfs_agino_t agino) in xfs_verify_agino() argument
193 if (agino < pag->agino_min) in xfs_verify_agino()
195 if (agino > pag->agino_max) in xfs_verify_agino()
205 xfs_verify_agino_or_null(struct xfs_perag *pag, xfs_agino_t agino) in xfs_verify_agino_or_null() argument
209 return xfs_verify_agino(pag, agino); in xfs_verify_agino_or_null()
224 struct xfs_perag *pag, in xfs_perag_next() argument
228 struct xfs_mount *mp = pag->pag_mount; in xfs_perag_next()
230 *agno = pag->pag_agno + 1; in xfs_perag_next()
231 xfs_perag_rele(pag); in xfs_perag_next()
233 pag = xfs_perag_grab(mp, *agno); in xfs_perag_next()
234 if (pag) in xfs_perag_next()
235 return pag; in xfs_perag_next()
241 #define for_each_perag_range(mp, agno, end_agno, pag) \ argument
242 for ((pag) = xfs_perag_grab((mp), (agno)); \
243 (pag) != NULL; \
244 (pag) = xfs_perag_next((pag), &(agno), (end_agno)))
246 #define for_each_perag_from(mp, agno, pag) \ argument
247 for_each_perag_range((mp), (agno), (mp)->m_sb.sb_agcount - 1, (pag))
249 #define for_each_perag(mp, agno, pag) \ argument
251 for_each_perag_from((mp), (agno), (pag))
253 #define for_each_perag_tag(mp, agno, pag, tag) \ argument
254 for ((agno) = 0, (pag) = xfs_perag_grab_tag((mp), 0, (tag)); \
255 (pag) != NULL; \
256 (agno) = (pag)->pag_agno + 1, \
257 xfs_perag_rele(pag), \
258 (pag) = xfs_perag_grab_tag((mp), (agno), (tag)))
262 struct xfs_perag *pag, in xfs_perag_next_wrap() argument
268 struct xfs_mount *mp = pag->pag_mount; in xfs_perag_next_wrap()
270 *agno = pag->pag_agno + 1; in xfs_perag_next_wrap()
271 xfs_perag_rele(pag); in xfs_perag_next_wrap()
279 pag = xfs_perag_grab(mp, *agno); in xfs_perag_next_wrap()
280 if (pag) in xfs_perag_next_wrap()
281 return pag; in xfs_perag_next_wrap()
291 #define for_each_perag_wrap_range(mp, start_agno, restart_agno, wrap_agno, agno, pag) \ argument
292 for ((agno) = (start_agno), (pag) = xfs_perag_grab((mp), (agno)); \
293 (pag) != NULL; \
294 (pag) = xfs_perag_next_wrap((pag), &(agno), (start_agno), \
300 #define for_each_perag_wrap_at(mp, start_agno, wrap_agno, agno, pag) \ argument
301 for_each_perag_wrap_range((mp), (start_agno), 0, (wrap_agno), (agno), (pag))
307 #define for_each_perag_wrap(mp, start_agno, agno, pag) \ argument
309 (agno), (pag))
326 int xfs_ag_shrink_space(struct xfs_perag *pag, struct xfs_trans **tpp,
328 int xfs_ag_extend_space(struct xfs_perag *pag, struct xfs_trans *tp,
330 int xfs_ag_get_geometry(struct xfs_perag *pag, struct xfs_ag_geometry *ageo);