Lines Matching defs:iwag

149 	struct xfs_iwalk_ag	*iwag)
153 ASSERT(iwag->recs == NULL);
154 iwag->nr_recs = 0;
157 size = iwag->sz_recs * sizeof(struct xfs_inobt_rec_incore);
158 iwag->recs = kmem_alloc(size, KM_MAYFAIL);
159 if (iwag->recs == NULL)
168 struct xfs_iwalk_ag *iwag)
170 kmem_free(iwag->recs);
171 iwag->recs = NULL;
177 struct xfs_iwalk_ag *iwag)
179 struct xfs_mount *mp = iwag->mp;
180 struct xfs_trans *tp = iwag->tp;
186 agno = XFS_INO_TO_AGNO(mp, iwag->startino);
187 for (i = 0; i < iwag->nr_recs; i++) {
188 struct xfs_inobt_rec_incore *irec = &iwag->recs[i];
192 if (xfs_pwork_want_abort(&iwag->pwork))
195 if (iwag->inobt_walk_fn) {
196 error = iwag->inobt_walk_fn(mp, tp, agno, irec,
197 iwag->data);
202 if (!iwag->iwalk_fn)
206 if (xfs_pwork_want_abort(&iwag->pwork))
215 error = iwag->iwalk_fn(mp, tp, ino, iwag->data);
259 struct xfs_iwalk_ag *iwag,
266 struct xfs_mount *mp = iwag->mp;
267 struct xfs_trans *tp = iwag->tp;
272 iwag->nr_recs = 0;
300 irec = &iwag->recs[iwag->nr_recs];
307 iwag->lastino = XFS_AGINO_TO_INO(mp, agno,
321 if (iwag->trim_start)
330 iwag->nr_recs++;
331 ASSERT(iwag->nr_recs < iwag->sz_recs);
347 struct xfs_iwalk_ag *iwag,
353 struct xfs_mount *mp = iwag->mp;
354 struct xfs_trans *tp = iwag->tp;
359 next_agino = XFS_INO_TO_AGINO(mp, iwag->lastino) + 1;
361 ASSERT(iwag->nr_recs > 0);
365 irec = &iwag->recs[iwag->nr_recs - 1];
368 error = xfs_iwalk_ag_recs(iwag);
373 iwag->nr_recs = 0;
386 /* Walk all inodes in a single AG, from @iwag->startino to the end of the AG. */
389 struct xfs_iwalk_ag *iwag)
391 struct xfs_mount *mp = iwag->mp;
392 struct xfs_trans *tp = iwag->tp;
401 agno = XFS_INO_TO_AGNO(mp, iwag->startino);
402 agino = XFS_INO_TO_AGINO(mp, iwag->startino);
403 error = xfs_iwalk_ag_start(iwag, agno, agino, &cur, &agi_bp, &has_more);
410 if (xfs_pwork_want_abort(&iwag->pwork))
414 irec = &iwag->recs[iwag->nr_recs];
421 if (iwag->lastino != NULLFSINO &&
422 XFS_IS_CORRUPT(mp, iwag->lastino >= rec_fsino)) {
426 iwag->lastino = rec_fsino + XFS_INODES_PER_CHUNK - 1;
429 if (iwag->skip_empty && irec->ir_freecount == irec->ir_count) {
440 if (iwag->iwalk_fn)
447 if (++iwag->nr_recs < iwag->sz_recs) {
461 error = xfs_iwalk_run_callbacks(iwag, agno, &cur, &agi_bp,
465 if (iwag->nr_recs == 0 || error)
469 error = xfs_iwalk_run_callbacks(iwag, agno, &cur, &agi_bp, &has_more);
546 struct xfs_iwalk_ag iwag = {
564 error = xfs_iwalk_alloc(&iwag);
569 error = xfs_iwalk_ag(&iwag);
572 iwag.startino = XFS_AGINO_TO_INO(mp, agno + 1, 0);
577 xfs_iwalk_free(&iwag);
587 struct xfs_iwalk_ag *iwag;
590 iwag = container_of(pwork, struct xfs_iwalk_ag, pwork);
594 error = xfs_iwalk_alloc(iwag);
598 error = xfs_iwalk_ag(iwag);
599 xfs_iwalk_free(iwag);
601 kmem_free(iwag);
634 struct xfs_iwalk_ag *iwag;
639 iwag = kmem_zalloc(sizeof(struct xfs_iwalk_ag), 0);
640 iwag->mp = mp;
641 iwag->iwalk_fn = iwalk_fn;
642 iwag->data = data;
643 iwag->startino = startino;
644 iwag->sz_recs = xfs_iwalk_prefetch(inode_records);
645 iwag->lastino = NULLFSINO;
646 xfs_pwork_queue(&pctl, &iwag->pwork);
711 struct xfs_iwalk_ag iwag = {
727 error = xfs_iwalk_alloc(&iwag);
732 error = xfs_iwalk_ag(&iwag);
735 iwag.startino = XFS_AGINO_TO_INO(mp, agno + 1, 0);
740 xfs_iwalk_free(&iwag);