Lines Matching +full:wait +full:- +full:pin

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2003 Silicon Graphics, Inc.
55 qlf->qlf_type = XFS_LI_DQUOT; in xfs_qm_dquot_logitem_format()
56 qlf->qlf_size = 2; in xfs_qm_dquot_logitem_format()
57 qlf->qlf_id = qlip->qli_dquot->q_id; in xfs_qm_dquot_logitem_format()
58 qlf->qlf_blkno = qlip->qli_dquot->q_blkno; in xfs_qm_dquot_logitem_format()
59 qlf->qlf_len = 1; in xfs_qm_dquot_logitem_format()
60 qlf->qlf_boffset = qlip->qli_dquot->q_bufoffset; in xfs_qm_dquot_logitem_format()
63 xfs_dquot_to_disk(&ddq, qlip->qli_dquot); in xfs_qm_dquot_logitem_format()
70 * Increment the pin count of the given dquot.
76 struct xfs_dquot *dqp = DQUOT_ITEM(lip)->qli_dquot; in xfs_qm_dquot_logitem_pin()
79 atomic_inc(&dqp->q_pincount); in xfs_qm_dquot_logitem_pin()
83 * Decrement the pin count of the given dquot, and wake up
93 struct xfs_dquot *dqp = DQUOT_ITEM(lip)->qli_dquot; in xfs_qm_dquot_logitem_unpin()
95 ASSERT(atomic_read(&dqp->q_pincount) > 0); in xfs_qm_dquot_logitem_unpin()
96 if (atomic_dec_and_test(&dqp->q_pincount)) in xfs_qm_dquot_logitem_unpin()
97 wake_up(&dqp->q_pinwait); in xfs_qm_dquot_logitem_unpin()
101 * This is called to wait for the given dquot to be unpinned.
102 * Most of these pin/unpin routines are plagiarized from inode code.
109 if (atomic_read(&dqp->q_pincount) == 0) in xfs_qm_dqunpin_wait()
113 * Give the log a push so we don't wait here too long. in xfs_qm_dqunpin_wait()
115 xfs_log_force(dqp->q_mount, 0); in xfs_qm_dqunpin_wait()
116 wait_event(dqp->q_pinwait, (atomic_read(&dqp->q_pincount) == 0)); in xfs_qm_dqunpin_wait()
123 __releases(&lip->li_ailp->ail_lock) in xfs_qm_dquot_logitem_push()
124 __acquires(&lip->li_ailp->ail_lock) in xfs_qm_dquot_logitem_push()
127 struct xfs_dquot *dqp = qlip->qli_dquot; in xfs_qm_dquot_logitem_push()
132 if (atomic_read(&dqp->q_pincount) > 0) in xfs_qm_dquot_logitem_push()
139 * Re-check the pincount now that we stabilized the value by in xfs_qm_dquot_logitem_push()
142 if (atomic_read(&dqp->q_pincount) > 0) { in xfs_qm_dquot_logitem_push()
149 * here but wait for the flush to finish and remove the item from in xfs_qm_dquot_logitem_push()
157 spin_unlock(&lip->li_ailp->ail_lock); in xfs_qm_dquot_logitem_push()
160 if (error == -EAGAIN) { in xfs_qm_dquot_logitem_push()
178 spin_lock(&lip->li_ailp->ail_lock); in xfs_qm_dquot_logitem_push()
188 struct xfs_dquot *dqp = DQUOT_ITEM(lip)->qli_dquot; in xfs_qm_dquot_logitem_release()
214 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_dquot_logitem_precommit_check()
219 fa = xfs_dquot_verify(mp, &ddq, dqp->q_id); in xfs_qm_dquot_logitem_precommit_check()
225 fa, dqp->q_id); in xfs_qm_dquot_logitem_precommit_check()
240 struct xfs_dquot *dqp = qlip->qli_dquot; in xfs_qm_dquot_logitem_precommit()
267 struct xfs_dq_logitem *lp = &dqp->q_logitem; in xfs_qm_dquot_logitem_init()
269 xfs_log_item_init(dqp->q_mount, &lp->qli_item, XFS_LI_DQUOT, in xfs_qm_dquot_logitem_init()
271 spin_lock_init(&lp->qli_lock); in xfs_qm_dquot_logitem_init()
272 lp->qli_dquot = dqp; in xfs_qm_dquot_logitem_init()
273 lp->qli_dirty = false; in xfs_qm_dquot_logitem_init()