Lines Matching refs:dqp
37 STATIC void xfs_qm_dqfree_one(struct xfs_dquot *dqp);
51 int (*execute)(struct xfs_dquot *dqp, void *data), in xfs_qm_dquot_walk() argument
80 struct xfs_dquot *dqp = batch[i]; in xfs_qm_dquot_walk() local
82 next_index = dqp->q_id + 1; in xfs_qm_dquot_walk()
119 struct xfs_dquot *dqp, in xfs_qm_dqpurge() argument
122 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_dqpurge()
126 xfs_dqlock(dqp); in xfs_qm_dqpurge()
127 if ((dqp->q_flags & XFS_DQFLAG_FREEING) || dqp->q_nrefs != 0) in xfs_qm_dqpurge()
130 dqp->q_flags |= XFS_DQFLAG_FREEING; in xfs_qm_dqpurge()
132 xfs_dqflock(dqp); in xfs_qm_dqpurge()
139 if (XFS_DQ_IS_DIRTY(dqp)) { in xfs_qm_dqpurge()
146 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_dqpurge()
151 dqp->q_flags &= ~XFS_DQFLAG_FREEING; in xfs_qm_dqpurge()
154 xfs_dqflock(dqp); in xfs_qm_dqpurge()
157 ASSERT(atomic_read(&dqp->q_pincount) == 0); in xfs_qm_dqpurge()
159 !test_bit(XFS_LI_IN_AIL, &dqp->q_logitem.qli_item.li_flags)); in xfs_qm_dqpurge()
161 xfs_dqfunlock(dqp); in xfs_qm_dqpurge()
162 xfs_dqunlock(dqp); in xfs_qm_dqpurge()
164 radix_tree_delete(xfs_dquot_tree(qi, xfs_dquot_type(dqp)), dqp->q_id); in xfs_qm_dqpurge()
171 ASSERT(!list_empty(&dqp->q_lru)); in xfs_qm_dqpurge()
172 list_lru_del(&qi->qi_lru, &dqp->q_lru); in xfs_qm_dqpurge()
175 xfs_qm_dqdestroy(dqp); in xfs_qm_dqpurge()
179 xfs_dqunlock(dqp); in xfs_qm_dqpurge()
256 struct xfs_dquot *dqp; in xfs_qm_dqattach_one() local
267 dqp = *IO_idqpp; in xfs_qm_dqattach_one()
268 if (dqp) { in xfs_qm_dqattach_one()
269 trace_xfs_dqattach_found(dqp); in xfs_qm_dqattach_one()
279 error = xfs_qm_dqget_inode(ip, type, doalloc, &dqp); in xfs_qm_dqattach_one()
283 trace_xfs_dqattach_get(dqp); in xfs_qm_dqattach_one()
289 *IO_idqpp = dqp; in xfs_qm_dqattach_one()
290 xfs_dqunlock(dqp); in xfs_qm_dqattach_one()
422 struct xfs_dquot *dqp = container_of(item, in xfs_qm_dquot_isolate() local
426 if (!xfs_dqlock_nowait(dqp)) in xfs_qm_dquot_isolate()
433 if (dqp->q_nrefs) { in xfs_qm_dquot_isolate()
434 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
435 XFS_STATS_INC(dqp->q_mount, xs_qm_dqwants); in xfs_qm_dquot_isolate()
437 trace_xfs_dqreclaim_want(dqp); in xfs_qm_dquot_isolate()
438 list_lru_isolate(lru, &dqp->q_lru); in xfs_qm_dquot_isolate()
439 XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot_unused); in xfs_qm_dquot_isolate()
448 if (!xfs_dqflock_nowait(dqp)) { in xfs_qm_dquot_isolate()
449 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
453 if (XFS_DQ_IS_DIRTY(dqp)) { in xfs_qm_dquot_isolate()
457 trace_xfs_dqreclaim_dirty(dqp); in xfs_qm_dquot_isolate()
462 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_dquot_isolate()
470 xfs_dqfunlock(dqp); in xfs_qm_dquot_isolate()
475 dqp->q_flags |= XFS_DQFLAG_FREEING; in xfs_qm_dquot_isolate()
476 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
478 ASSERT(dqp->q_nrefs == 0); in xfs_qm_dquot_isolate()
479 list_lru_isolate_move(lru, &dqp->q_lru, &isol->dispose); in xfs_qm_dquot_isolate()
480 XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot_unused); in xfs_qm_dquot_isolate()
481 trace_xfs_dqreclaim_done(dqp); in xfs_qm_dquot_isolate()
482 XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaims); in xfs_qm_dquot_isolate()
486 trace_xfs_dqreclaim_busy(dqp); in xfs_qm_dquot_isolate()
487 XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaim_misses); in xfs_qm_dquot_isolate()
491 trace_xfs_dqreclaim_busy(dqp); in xfs_qm_dquot_isolate()
492 XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaim_misses); in xfs_qm_dquot_isolate()
493 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
523 struct xfs_dquot *dqp; in xfs_qm_shrink_scan() local
525 dqp = list_first_entry(&isol.dispose, struct xfs_dquot, q_lru); in xfs_qm_shrink_scan()
526 list_del_init(&dqp->q_lru); in xfs_qm_shrink_scan()
527 xfs_qm_dqfree_one(dqp); in xfs_qm_shrink_scan()
550 struct xfs_dquot *dqp; in xfs_qm_set_defquota() local
554 error = xfs_qm_dqget_uncached(mp, 0, type, &dqp); in xfs_qm_set_defquota()
558 defq = xfs_get_defquota(qinf, xfs_dquot_type(dqp)); in xfs_qm_set_defquota()
564 defq->blk.hard = dqp->q_blk.hardlimit; in xfs_qm_set_defquota()
565 defq->blk.soft = dqp->q_blk.softlimit; in xfs_qm_set_defquota()
566 defq->ino.hard = dqp->q_ino.hardlimit; in xfs_qm_set_defquota()
567 defq->ino.soft = dqp->q_ino.softlimit; in xfs_qm_set_defquota()
568 defq->rtb.hard = dqp->q_rtb.hardlimit; in xfs_qm_set_defquota()
569 defq->rtb.soft = dqp->q_rtb.softlimit; in xfs_qm_set_defquota()
570 xfs_qm_dqdestroy(dqp); in xfs_qm_set_defquota()
581 struct xfs_dquot *dqp; in xfs_qm_init_timelimits() local
600 error = xfs_qm_dqget_uncached(mp, 0, type, &dqp); in xfs_qm_init_timelimits()
609 if (dqp->q_blk.timer) in xfs_qm_init_timelimits()
610 defq->blk.time = dqp->q_blk.timer; in xfs_qm_init_timelimits()
611 if (dqp->q_ino.timer) in xfs_qm_init_timelimits()
612 defq->ino.time = dqp->q_ino.timer; in xfs_qm_init_timelimits()
613 if (dqp->q_rtb.timer) in xfs_qm_init_timelimits()
614 defq->rtb.time = dqp->q_rtb.timer; in xfs_qm_init_timelimits()
615 if (dqp->q_blk.warnings) in xfs_qm_init_timelimits()
616 defq->blk.warn = dqp->q_blk.warnings; in xfs_qm_init_timelimits()
617 if (dqp->q_ino.warnings) in xfs_qm_init_timelimits()
618 defq->ino.warn = dqp->q_ino.warnings; in xfs_qm_init_timelimits()
619 if (dqp->q_rtb.warnings) in xfs_qm_init_timelimits()
620 defq->rtb.warn = dqp->q_rtb.warnings; in xfs_qm_init_timelimits()
622 xfs_qm_dqdestroy(dqp); in xfs_qm_init_timelimits()
1079 struct xfs_dquot *dqp; in xfs_qm_quotacheck_dqadjust() local
1084 error = xfs_qm_dqget(mp, id, type, true, &dqp); in xfs_qm_quotacheck_dqadjust()
1094 trace_xfs_dqadjust(dqp); in xfs_qm_quotacheck_dqadjust()
1100 dqp->q_ino.count++; in xfs_qm_quotacheck_dqadjust()
1101 dqp->q_ino.reserved++; in xfs_qm_quotacheck_dqadjust()
1103 dqp->q_blk.count += nblks; in xfs_qm_quotacheck_dqadjust()
1104 dqp->q_blk.reserved += nblks; in xfs_qm_quotacheck_dqadjust()
1107 dqp->q_rtb.count += rtblks; in xfs_qm_quotacheck_dqadjust()
1108 dqp->q_rtb.reserved += rtblks; in xfs_qm_quotacheck_dqadjust()
1116 if (dqp->q_id) { in xfs_qm_quotacheck_dqadjust()
1117 xfs_qm_adjust_dqlimits(dqp); in xfs_qm_quotacheck_dqadjust()
1118 xfs_qm_adjust_dqtimers(dqp); in xfs_qm_quotacheck_dqadjust()
1121 dqp->q_flags |= XFS_DQFLAG_DIRTY; in xfs_qm_quotacheck_dqadjust()
1122 xfs_qm_dqput(dqp); in xfs_qm_quotacheck_dqadjust()
1218 struct xfs_dquot *dqp, in xfs_qm_flush_one() argument
1221 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_flush_one()
1226 xfs_dqlock(dqp); in xfs_qm_flush_one()
1227 if (dqp->q_flags & XFS_DQFLAG_FREEING) in xfs_qm_flush_one()
1229 if (!XFS_DQ_IS_DIRTY(dqp)) in xfs_qm_flush_one()
1240 if (!xfs_dqflock_nowait(dqp)) { in xfs_qm_flush_one()
1242 bp = xfs_buf_incore(mp->m_ddev_targp, dqp->q_blkno, in xfs_qm_flush_one()
1257 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_flush_one()
1264 xfs_dqunlock(dqp); in xfs_qm_flush_one()
1603 struct xfs_dquot *dqp) in xfs_qm_dqfree_one() argument
1605 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_dqfree_one()
1609 radix_tree_delete(xfs_dquot_tree(qi, xfs_dquot_type(dqp)), dqp->q_id); in xfs_qm_dqfree_one()
1614 xfs_qm_dqdestroy(dqp); in xfs_qm_dqfree_one()