Lines Matching refs:dqp

51 STATIC void	xfs_qm_dqfree_one(struct xfs_dquot *dqp);
65 int (*execute)(struct xfs_dquot *dqp, void *data), in xfs_qm_dquot_walk() argument
94 struct xfs_dquot *dqp = batch[i]; in xfs_qm_dquot_walk() local
96 next_index = be32_to_cpu(dqp->q_core.d_id) + 1; in xfs_qm_dquot_walk()
130 struct xfs_dquot *dqp, in xfs_qm_dqpurge() argument
133 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_dqpurge()
136 xfs_dqlock(dqp); in xfs_qm_dqpurge()
137 if ((dqp->dq_flags & XFS_DQ_FREEING) || dqp->q_nrefs != 0) { in xfs_qm_dqpurge()
138 xfs_dqunlock(dqp); in xfs_qm_dqpurge()
142 dqp->dq_flags |= XFS_DQ_FREEING; in xfs_qm_dqpurge()
144 xfs_dqflock(dqp); in xfs_qm_dqpurge()
151 if (XFS_DQ_IS_DIRTY(dqp)) { in xfs_qm_dqpurge()
159 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_dqpurge()
162 __func__, dqp); in xfs_qm_dqpurge()
167 xfs_dqflock(dqp); in xfs_qm_dqpurge()
170 ASSERT(atomic_read(&dqp->q_pincount) == 0); in xfs_qm_dqpurge()
172 !(dqp->q_logitem.qli_item.li_flags & XFS_LI_IN_AIL)); in xfs_qm_dqpurge()
174 xfs_dqfunlock(dqp); in xfs_qm_dqpurge()
175 xfs_dqunlock(dqp); in xfs_qm_dqpurge()
177 radix_tree_delete(xfs_dquot_tree(qi, dqp->q_core.d_flags), in xfs_qm_dqpurge()
178 be32_to_cpu(dqp->q_core.d_id)); in xfs_qm_dqpurge()
185 ASSERT(!list_empty(&dqp->q_lru)); in xfs_qm_dqpurge()
186 list_lru_del(&qi->qi_lru, &dqp->q_lru); in xfs_qm_dqpurge()
189 xfs_qm_dqdestroy(dqp); in xfs_qm_dqpurge()
267 xfs_dquot_t *dqp; in xfs_qm_dqattach_one() local
278 dqp = *IO_idqpp; in xfs_qm_dqattach_one()
279 if (dqp) { in xfs_qm_dqattach_one()
280 trace_xfs_dqattach_found(dqp); in xfs_qm_dqattach_one()
291 doalloc | XFS_QMOPT_DOWARN, &dqp); in xfs_qm_dqattach_one()
295 trace_xfs_dqattach_get(dqp); in xfs_qm_dqattach_one()
301 *IO_idqpp = dqp; in xfs_qm_dqattach_one()
302 xfs_dqunlock(dqp); in xfs_qm_dqattach_one()
438 struct xfs_dquot *dqp = container_of(item, in xfs_qm_dquot_isolate() local
442 if (!xfs_dqlock_nowait(dqp)) in xfs_qm_dquot_isolate()
449 if (dqp->q_nrefs) { in xfs_qm_dquot_isolate()
450 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
453 trace_xfs_dqreclaim_want(dqp); in xfs_qm_dquot_isolate()
454 list_lru_isolate(lru, &dqp->q_lru); in xfs_qm_dquot_isolate()
464 if (!xfs_dqflock_nowait(dqp)) { in xfs_qm_dquot_isolate()
465 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
469 if (XFS_DQ_IS_DIRTY(dqp)) { in xfs_qm_dquot_isolate()
473 trace_xfs_dqreclaim_dirty(dqp); in xfs_qm_dquot_isolate()
478 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_dquot_isolate()
480 xfs_warn(dqp->q_mount, "%s: dquot %p flush failed", in xfs_qm_dquot_isolate()
481 __func__, dqp); in xfs_qm_dquot_isolate()
489 xfs_dqfunlock(dqp); in xfs_qm_dquot_isolate()
494 dqp->dq_flags |= XFS_DQ_FREEING; in xfs_qm_dquot_isolate()
495 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
497 ASSERT(dqp->q_nrefs == 0); in xfs_qm_dquot_isolate()
498 list_lru_isolate_move(lru, &dqp->q_lru, &isol->dispose); in xfs_qm_dquot_isolate()
500 trace_xfs_dqreclaim_done(dqp); in xfs_qm_dquot_isolate()
505 trace_xfs_dqreclaim_busy(dqp); in xfs_qm_dquot_isolate()
510 trace_xfs_dqreclaim_busy(dqp); in xfs_qm_dquot_isolate()
512 xfs_dqunlock(dqp); in xfs_qm_dquot_isolate()
542 struct xfs_dquot *dqp; in xfs_qm_shrink_scan() local
544 dqp = list_first_entry(&isol.dispose, struct xfs_dquot, q_lru); in xfs_qm_shrink_scan()
545 list_del_init(&dqp->q_lru); in xfs_qm_shrink_scan()
546 xfs_qm_dqfree_one(dqp); in xfs_qm_shrink_scan()
573 xfs_dquot_t *dqp; in xfs_qm_init_quotainfo() local
621 XFS_QMOPT_DOWARN, &dqp); in xfs_qm_init_quotainfo()
623 xfs_disk_dquot_t *ddqp = &dqp->q_core; in xfs_qm_init_quotainfo()
649 xfs_qm_dqdestroy(dqp); in xfs_qm_init_quotainfo()
1047 struct xfs_dquot *dqp; in xfs_qm_quotacheck_dqadjust() local
1051 XFS_QMOPT_DQALLOC | XFS_QMOPT_DOWARN, &dqp); in xfs_qm_quotacheck_dqadjust()
1061 trace_xfs_dqadjust(dqp); in xfs_qm_quotacheck_dqadjust()
1067 be64_add_cpu(&dqp->q_core.d_icount, 1); in xfs_qm_quotacheck_dqadjust()
1068 dqp->q_res_icount++; in xfs_qm_quotacheck_dqadjust()
1070 be64_add_cpu(&dqp->q_core.d_bcount, nblks); in xfs_qm_quotacheck_dqadjust()
1071 dqp->q_res_bcount += nblks; in xfs_qm_quotacheck_dqadjust()
1074 be64_add_cpu(&dqp->q_core.d_rtbcount, rtblks); in xfs_qm_quotacheck_dqadjust()
1075 dqp->q_res_rtbcount += rtblks; in xfs_qm_quotacheck_dqadjust()
1083 if (dqp->q_core.d_id) { in xfs_qm_quotacheck_dqadjust()
1084 xfs_qm_adjust_dqlimits(mp, dqp); in xfs_qm_quotacheck_dqadjust()
1085 xfs_qm_adjust_dqtimers(mp, &dqp->q_core); in xfs_qm_quotacheck_dqadjust()
1088 dqp->dq_flags |= XFS_DQ_DIRTY; in xfs_qm_quotacheck_dqadjust()
1089 xfs_qm_dqput(dqp); in xfs_qm_quotacheck_dqadjust()
1219 struct xfs_dquot *dqp, in xfs_qm_flush_one() argument
1226 xfs_dqlock(dqp); in xfs_qm_flush_one()
1227 if (dqp->dq_flags & XFS_DQ_FREEING) in xfs_qm_flush_one()
1229 if (!XFS_DQ_IS_DIRTY(dqp)) in xfs_qm_flush_one()
1232 xfs_dqflock(dqp); in xfs_qm_flush_one()
1233 error = xfs_qm_dqflush(dqp, &bp); in xfs_qm_flush_one()
1240 xfs_dqunlock(dqp); in xfs_qm_flush_one()
1572 struct xfs_dquot *dqp) in xfs_qm_dqfree_one() argument
1574 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_dqfree_one()
1578 radix_tree_delete(xfs_dquot_tree(qi, dqp->q_core.d_flags), in xfs_qm_dqfree_one()
1579 be32_to_cpu(dqp->q_core.d_id)); in xfs_qm_dqfree_one()
1584 xfs_qm_dqdestroy(dqp); in xfs_qm_dqfree_one()