Lines Matching refs:dqp

41 STATIC void	xfs_qm_dqfree_one(struct xfs_dquot *dqp);
55 int (*execute)(struct xfs_dquot *dqp, void *data), in xfs_qm_dquot_walk() argument
84 struct xfs_dquot *dqp = batch[i]; in xfs_qm_dquot_walk() local
86 next_index = dqp->q_id + 1; in xfs_qm_dquot_walk()
123 struct xfs_dquot *dqp, in xfs_qm_dqpurge() argument
126 struct xfs_quotainfo *qi = dqp->q_mount->m_quotainfo; in xfs_qm_dqpurge()
129 xfs_dqlock(dqp); in xfs_qm_dqpurge()
130 if ((dqp->q_flags & XFS_DQFLAG_FREEING) || dqp->q_nrefs != 0) in xfs_qm_dqpurge()
133 dqp->q_flags |= XFS_DQFLAG_FREEING; in xfs_qm_dqpurge()
135 xfs_dqflock(dqp); in xfs_qm_dqpurge()
142 if (XFS_DQ_IS_DIRTY(dqp)) { in xfs_qm_dqpurge()
149 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_dqpurge()
154 dqp->q_flags &= ~XFS_DQFLAG_FREEING; in xfs_qm_dqpurge()
157 xfs_dqflock(dqp); in xfs_qm_dqpurge()
160 ASSERT(atomic_read(&dqp->q_pincount) == 0); in xfs_qm_dqpurge()
161 ASSERT(xlog_is_shutdown(dqp->q_logitem.qli_item.li_log) || in xfs_qm_dqpurge()
162 !test_bit(XFS_LI_IN_AIL, &dqp->q_logitem.qli_item.li_flags)); in xfs_qm_dqpurge()
164 xfs_dqfunlock(dqp); in xfs_qm_dqpurge()
165 xfs_dqunlock(dqp); in xfs_qm_dqpurge()
167 radix_tree_delete(xfs_dquot_tree(qi, xfs_dquot_type(dqp)), dqp->q_id); in xfs_qm_dqpurge()
174 ASSERT(!list_empty(&dqp->q_lru)); in xfs_qm_dqpurge()
175 list_lru_del_obj(&qi->qi_lru, &dqp->q_lru); in xfs_qm_dqpurge()
176 XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot_unused); in xfs_qm_dqpurge()
178 xfs_qm_dqdestroy(dqp); in xfs_qm_dqpurge()
182 xfs_dqunlock(dqp); in xfs_qm_dqpurge()
255 struct xfs_dquot *dqp; in xfs_qm_dqattach_one() local
266 dqp = *IO_idqpp; in xfs_qm_dqattach_one()
267 if (dqp) { in xfs_qm_dqattach_one()
268 trace_xfs_dqattach_found(dqp); in xfs_qm_dqattach_one()
278 error = xfs_qm_dqget_inode(ip, type, doalloc, &dqp); in xfs_qm_dqattach_one()
282 trace_xfs_dqattach_get(dqp); in xfs_qm_dqattach_one()
288 *IO_idqpp = dqp; in xfs_qm_dqattach_one()
289 xfs_dqunlock(dqp); in xfs_qm_dqattach_one()
419 struct xfs_dquot *dqp = container_of(item, in xfs_qm_dquot_isolate() local
423 if (!xfs_dqlock_nowait(dqp)) in xfs_qm_dquot_isolate()
431 if (dqp->q_flags & XFS_DQFLAG_FREEING) in xfs_qm_dquot_isolate()
438 if (dqp->q_nrefs) { in xfs_qm_dquot_isolate()
439 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
440 XFS_STATS_INC(dqp->q_mount, xs_qm_dqwants); in xfs_qm_dquot_isolate()
442 trace_xfs_dqreclaim_want(dqp); in xfs_qm_dquot_isolate()
443 list_lru_isolate(lru, &dqp->q_lru); in xfs_qm_dquot_isolate()
444 XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot_unused); in xfs_qm_dquot_isolate()
453 if (!xfs_dqflock_nowait(dqp)) in xfs_qm_dquot_isolate()
456 if (XFS_DQ_IS_DIRTY(dqp)) { in xfs_qm_dquot_isolate()
460 trace_xfs_dqreclaim_dirty(dqp); in xfs_qm_dquot_isolate()
465 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_dquot_isolate()
473 xfs_dqfunlock(dqp); in xfs_qm_dquot_isolate()
478 dqp->q_flags |= XFS_DQFLAG_FREEING; in xfs_qm_dquot_isolate()
479 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
481 ASSERT(dqp->q_nrefs == 0); in xfs_qm_dquot_isolate()
482 list_lru_isolate_move(lru, &dqp->q_lru, &isol->dispose); in xfs_qm_dquot_isolate()
483 XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot_unused); in xfs_qm_dquot_isolate()
484 trace_xfs_dqreclaim_done(dqp); in xfs_qm_dquot_isolate()
485 XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaims); in xfs_qm_dquot_isolate()
489 xfs_dqunlock(dqp); 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()
496 trace_xfs_dqreclaim_busy(dqp); in xfs_qm_dquot_isolate()
497 XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaim_misses); in xfs_qm_dquot_isolate()
498 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
527 struct xfs_dquot *dqp; in xfs_qm_shrink_scan() local
529 dqp = list_first_entry(&isol.dispose, struct xfs_dquot, q_lru); in xfs_qm_shrink_scan()
530 list_del_init(&dqp->q_lru); in xfs_qm_shrink_scan()
531 xfs_qm_dqfree_one(dqp); in xfs_qm_shrink_scan()
553 struct xfs_dquot *dqp; in xfs_qm_set_defquota() local
557 error = xfs_qm_dqget_uncached(mp, 0, type, &dqp); in xfs_qm_set_defquota()
561 defq = xfs_get_defquota(qinf, xfs_dquot_type(dqp)); in xfs_qm_set_defquota()
567 defq->blk.hard = dqp->q_blk.hardlimit; in xfs_qm_set_defquota()
568 defq->blk.soft = dqp->q_blk.softlimit; in xfs_qm_set_defquota()
569 defq->ino.hard = dqp->q_ino.hardlimit; in xfs_qm_set_defquota()
570 defq->ino.soft = dqp->q_ino.softlimit; in xfs_qm_set_defquota()
571 defq->rtb.hard = dqp->q_rtb.hardlimit; in xfs_qm_set_defquota()
572 defq->rtb.soft = dqp->q_rtb.softlimit; in xfs_qm_set_defquota()
573 xfs_qm_dqdestroy(dqp); in xfs_qm_set_defquota()
584 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()
616 xfs_qm_dqdestroy(dqp); in xfs_qm_init_timelimits()
1096 struct xfs_dquot *dqp; in xfs_qm_quotacheck_dqadjust() local
1101 error = xfs_qm_dqget(mp, id, type, true, &dqp); in xfs_qm_quotacheck_dqadjust()
1111 trace_xfs_dqadjust(dqp); in xfs_qm_quotacheck_dqadjust()
1117 dqp->q_ino.count++; in xfs_qm_quotacheck_dqadjust()
1118 dqp->q_ino.reserved++; in xfs_qm_quotacheck_dqadjust()
1120 dqp->q_blk.count += nblks; in xfs_qm_quotacheck_dqadjust()
1121 dqp->q_blk.reserved += nblks; in xfs_qm_quotacheck_dqadjust()
1124 dqp->q_rtb.count += rtblks; in xfs_qm_quotacheck_dqadjust()
1125 dqp->q_rtb.reserved += rtblks; in xfs_qm_quotacheck_dqadjust()
1133 if (dqp->q_id) { in xfs_qm_quotacheck_dqadjust()
1134 xfs_qm_adjust_dqlimits(dqp); in xfs_qm_quotacheck_dqadjust()
1135 xfs_qm_adjust_dqtimers(dqp); in xfs_qm_quotacheck_dqadjust()
1138 dqp->q_flags |= XFS_DQFLAG_DIRTY; in xfs_qm_quotacheck_dqadjust()
1139 xfs_qm_dqput(dqp); in xfs_qm_quotacheck_dqadjust()
1247 struct xfs_dquot *dqp, in xfs_qm_flush_one() argument
1250 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_flush_one()
1255 xfs_dqlock(dqp); in xfs_qm_flush_one()
1256 if (dqp->q_flags & XFS_DQFLAG_FREEING) in xfs_qm_flush_one()
1258 if (!XFS_DQ_IS_DIRTY(dqp)) in xfs_qm_flush_one()
1269 if (!xfs_dqflock_nowait(dqp)) { in xfs_qm_flush_one()
1271 error = xfs_buf_incore(mp->m_ddev_targp, dqp->q_blkno, in xfs_qm_flush_one()
1290 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_flush_one()
1297 xfs_dqunlock(dqp); in xfs_qm_flush_one()
1688 struct xfs_dquot *dqp) in xfs_qm_dqfree_one() argument
1690 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_dqfree_one()
1694 radix_tree_delete(xfs_dquot_tree(qi, xfs_dquot_type(dqp)), dqp->q_id); in xfs_qm_dqfree_one()
1699 xfs_qm_dqdestroy(dqp); in xfs_qm_dqfree_one()
1983 struct xfs_dquot *dqp; in xfs_inode_near_dquot_enforcement() local
1987 dqp = xfs_inode_dquot(ip, type); in xfs_inode_near_dquot_enforcement()
1988 if (!dqp || !xfs_dquot_is_enforced(dqp)) in xfs_inode_near_dquot_enforcement()
1991 if (xfs_dquot_res_over_limits(&dqp->q_ino) || in xfs_inode_near_dquot_enforcement()
1992 xfs_dquot_res_over_limits(&dqp->q_rtb)) in xfs_inode_near_dquot_enforcement()
1996 if (!dqp->q_prealloc_hi_wmark) in xfs_inode_near_dquot_enforcement()
1999 if (dqp->q_blk.reserved < dqp->q_prealloc_lo_wmark) in xfs_inode_near_dquot_enforcement()
2002 if (dqp->q_blk.reserved >= dqp->q_prealloc_hi_wmark) in xfs_inode_near_dquot_enforcement()
2005 freesp = dqp->q_prealloc_hi_wmark - dqp->q_blk.reserved; in xfs_inode_near_dquot_enforcement()
2006 if (freesp < dqp->q_low_space[XFS_QLOWSP_5_PCNT]) in xfs_inode_near_dquot_enforcement()