Lines Matching refs:dqp

40 STATIC void	xfs_qm_dqfree_one(struct xfs_dquot *dqp);
54 int (*execute)(struct xfs_dquot *dqp, void *data), in xfs_qm_dquot_walk() argument
83 struct xfs_dquot *dqp = batch[i]; in xfs_qm_dquot_walk() local
85 next_index = dqp->q_id + 1; in xfs_qm_dquot_walk()
122 struct xfs_dquot *dqp, in xfs_qm_dqpurge() argument
125 struct xfs_quotainfo *qi = dqp->q_mount->m_quotainfo; in xfs_qm_dqpurge()
128 xfs_dqlock(dqp); in xfs_qm_dqpurge()
129 if ((dqp->q_flags & XFS_DQFLAG_FREEING) || dqp->q_nrefs != 0) in xfs_qm_dqpurge()
132 dqp->q_flags |= XFS_DQFLAG_FREEING; in xfs_qm_dqpurge()
134 xfs_dqflock(dqp); in xfs_qm_dqpurge()
141 if (XFS_DQ_IS_DIRTY(dqp)) { in xfs_qm_dqpurge()
148 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_dqpurge()
153 dqp->q_flags &= ~XFS_DQFLAG_FREEING; in xfs_qm_dqpurge()
156 xfs_dqflock(dqp); in xfs_qm_dqpurge()
159 ASSERT(atomic_read(&dqp->q_pincount) == 0); in xfs_qm_dqpurge()
160 ASSERT(xlog_is_shutdown(dqp->q_logitem.qli_item.li_log) || in xfs_qm_dqpurge()
161 !test_bit(XFS_LI_IN_AIL, &dqp->q_logitem.qli_item.li_flags)); in xfs_qm_dqpurge()
163 xfs_dqfunlock(dqp); in xfs_qm_dqpurge()
164 xfs_dqunlock(dqp); in xfs_qm_dqpurge()
166 radix_tree_delete(xfs_dquot_tree(qi, xfs_dquot_type(dqp)), dqp->q_id); in xfs_qm_dqpurge()
173 ASSERT(!list_empty(&dqp->q_lru)); in xfs_qm_dqpurge()
174 list_lru_del(&qi->qi_lru, &dqp->q_lru); in xfs_qm_dqpurge()
175 XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot_unused); in xfs_qm_dqpurge()
177 xfs_qm_dqdestroy(dqp); in xfs_qm_dqpurge()
181 xfs_dqunlock(dqp); in xfs_qm_dqpurge()
254 struct xfs_dquot *dqp; in xfs_qm_dqattach_one() local
265 dqp = *IO_idqpp; in xfs_qm_dqattach_one()
266 if (dqp) { in xfs_qm_dqattach_one()
267 trace_xfs_dqattach_found(dqp); in xfs_qm_dqattach_one()
277 error = xfs_qm_dqget_inode(ip, type, doalloc, &dqp); in xfs_qm_dqattach_one()
281 trace_xfs_dqattach_get(dqp); in xfs_qm_dqattach_one()
287 *IO_idqpp = dqp; in xfs_qm_dqattach_one()
288 xfs_dqunlock(dqp); in xfs_qm_dqattach_one()
418 struct xfs_dquot *dqp = container_of(item, in xfs_qm_dquot_isolate() local
422 if (!xfs_dqlock_nowait(dqp)) in xfs_qm_dquot_isolate()
430 if (dqp->q_flags & XFS_DQFLAG_FREEING) in xfs_qm_dquot_isolate()
437 if (dqp->q_nrefs) { in xfs_qm_dquot_isolate()
438 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
439 XFS_STATS_INC(dqp->q_mount, xs_qm_dqwants); in xfs_qm_dquot_isolate()
441 trace_xfs_dqreclaim_want(dqp); in xfs_qm_dquot_isolate()
442 list_lru_isolate(lru, &dqp->q_lru); in xfs_qm_dquot_isolate()
443 XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot_unused); in xfs_qm_dquot_isolate()
452 if (!xfs_dqflock_nowait(dqp)) in xfs_qm_dquot_isolate()
455 if (XFS_DQ_IS_DIRTY(dqp)) { in xfs_qm_dquot_isolate()
459 trace_xfs_dqreclaim_dirty(dqp); in xfs_qm_dquot_isolate()
464 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_dquot_isolate()
472 xfs_dqfunlock(dqp); in xfs_qm_dquot_isolate()
477 dqp->q_flags |= XFS_DQFLAG_FREEING; in xfs_qm_dquot_isolate()
478 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
480 ASSERT(dqp->q_nrefs == 0); in xfs_qm_dquot_isolate()
481 list_lru_isolate_move(lru, &dqp->q_lru, &isol->dispose); in xfs_qm_dquot_isolate()
482 XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot_unused); in xfs_qm_dquot_isolate()
483 trace_xfs_dqreclaim_done(dqp); in xfs_qm_dquot_isolate()
484 XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaims); in xfs_qm_dquot_isolate()
488 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
490 trace_xfs_dqreclaim_busy(dqp); in xfs_qm_dquot_isolate()
491 XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaim_misses); in xfs_qm_dquot_isolate()
495 trace_xfs_dqreclaim_busy(dqp); in xfs_qm_dquot_isolate()
496 XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaim_misses); in xfs_qm_dquot_isolate()
497 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()
554 struct xfs_dquot *dqp; in xfs_qm_set_defquota() local
558 error = xfs_qm_dqget_uncached(mp, 0, type, &dqp); in xfs_qm_set_defquota()
562 defq = xfs_get_defquota(qinf, xfs_dquot_type(dqp)); in xfs_qm_set_defquota()
568 defq->blk.hard = dqp->q_blk.hardlimit; in xfs_qm_set_defquota()
569 defq->blk.soft = dqp->q_blk.softlimit; in xfs_qm_set_defquota()
570 defq->ino.hard = dqp->q_ino.hardlimit; in xfs_qm_set_defquota()
571 defq->ino.soft = dqp->q_ino.softlimit; in xfs_qm_set_defquota()
572 defq->rtb.hard = dqp->q_rtb.hardlimit; in xfs_qm_set_defquota()
573 defq->rtb.soft = dqp->q_rtb.softlimit; in xfs_qm_set_defquota()
574 xfs_qm_dqdestroy(dqp); in xfs_qm_set_defquota()
585 struct xfs_dquot *dqp; in xfs_qm_init_timelimits() local
601 error = xfs_qm_dqget_uncached(mp, 0, type, &dqp); in xfs_qm_init_timelimits()
610 if (dqp->q_blk.timer) in xfs_qm_init_timelimits()
611 defq->blk.time = dqp->q_blk.timer; in xfs_qm_init_timelimits()
612 if (dqp->q_ino.timer) in xfs_qm_init_timelimits()
613 defq->ino.time = dqp->q_ino.timer; in xfs_qm_init_timelimits()
614 if (dqp->q_rtb.timer) in xfs_qm_init_timelimits()
615 defq->rtb.time = dqp->q_rtb.timer; in xfs_qm_init_timelimits()
617 xfs_qm_dqdestroy(dqp); in xfs_qm_init_timelimits()
1080 struct xfs_dquot *dqp; in xfs_qm_quotacheck_dqadjust() local
1085 error = xfs_qm_dqget(mp, id, type, true, &dqp); in xfs_qm_quotacheck_dqadjust()
1095 trace_xfs_dqadjust(dqp); in xfs_qm_quotacheck_dqadjust()
1101 dqp->q_ino.count++; in xfs_qm_quotacheck_dqadjust()
1102 dqp->q_ino.reserved++; in xfs_qm_quotacheck_dqadjust()
1104 dqp->q_blk.count += nblks; in xfs_qm_quotacheck_dqadjust()
1105 dqp->q_blk.reserved += nblks; in xfs_qm_quotacheck_dqadjust()
1108 dqp->q_rtb.count += rtblks; in xfs_qm_quotacheck_dqadjust()
1109 dqp->q_rtb.reserved += rtblks; in xfs_qm_quotacheck_dqadjust()
1117 if (dqp->q_id) { in xfs_qm_quotacheck_dqadjust()
1118 xfs_qm_adjust_dqlimits(dqp); in xfs_qm_quotacheck_dqadjust()
1119 xfs_qm_adjust_dqtimers(dqp); in xfs_qm_quotacheck_dqadjust()
1122 dqp->q_flags |= XFS_DQFLAG_DIRTY; in xfs_qm_quotacheck_dqadjust()
1123 xfs_qm_dqput(dqp); in xfs_qm_quotacheck_dqadjust()
1231 struct xfs_dquot *dqp, in xfs_qm_flush_one() argument
1234 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_flush_one()
1239 xfs_dqlock(dqp); in xfs_qm_flush_one()
1240 if (dqp->q_flags & XFS_DQFLAG_FREEING) in xfs_qm_flush_one()
1242 if (!XFS_DQ_IS_DIRTY(dqp)) in xfs_qm_flush_one()
1253 if (!xfs_dqflock_nowait(dqp)) { in xfs_qm_flush_one()
1255 error = xfs_buf_incore(mp->m_ddev_targp, dqp->q_blkno, in xfs_qm_flush_one()
1274 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_flush_one()
1281 xfs_dqunlock(dqp); in xfs_qm_flush_one()
1634 struct xfs_dquot *dqp) in xfs_qm_dqfree_one() argument
1636 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_dqfree_one()
1640 radix_tree_delete(xfs_dquot_tree(qi, xfs_dquot_type(dqp)), dqp->q_id); in xfs_qm_dqfree_one()
1645 xfs_qm_dqdestroy(dqp); in xfs_qm_dqfree_one()
1930 struct xfs_dquot *dqp; in xfs_inode_near_dquot_enforcement() local
1934 dqp = xfs_inode_dquot(ip, type); in xfs_inode_near_dquot_enforcement()
1935 if (!dqp || !xfs_dquot_is_enforced(dqp)) in xfs_inode_near_dquot_enforcement()
1938 if (xfs_dquot_res_over_limits(&dqp->q_ino) || in xfs_inode_near_dquot_enforcement()
1939 xfs_dquot_res_over_limits(&dqp->q_rtb)) in xfs_inode_near_dquot_enforcement()
1943 if (!dqp->q_prealloc_hi_wmark) in xfs_inode_near_dquot_enforcement()
1946 if (dqp->q_blk.reserved < dqp->q_prealloc_lo_wmark) in xfs_inode_near_dquot_enforcement()
1949 if (dqp->q_blk.reserved >= dqp->q_prealloc_hi_wmark) in xfs_inode_near_dquot_enforcement()
1952 freesp = dqp->q_prealloc_hi_wmark - dqp->q_blk.reserved; in xfs_inode_near_dquot_enforcement()
1953 if (freesp < dqp->q_low_space[XFS_QLOWSP_5_PCNT]) in xfs_inode_near_dquot_enforcement()