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()
126 struct xfs_dquot *dqp = DQUOT_ITEM(lip)->qli_dquot; in xfs_qm_dquot_logitem_push()
127 struct xfs_buf *bp = lip->li_buf; in xfs_qm_dquot_logitem_push()
131 if (atomic_read(&dqp->q_pincount) > 0) in xfs_qm_dquot_logitem_push()
138 * Re-check the pincount now that we stabilized the value by in xfs_qm_dquot_logitem_push()
141 if (atomic_read(&dqp->q_pincount) > 0) { in xfs_qm_dquot_logitem_push()
148 * here but wait for the flush to finish and remove the item from in xfs_qm_dquot_logitem_push()
156 spin_unlock(&lip->li_ailp->ail_lock); in xfs_qm_dquot_logitem_push()
163 } else if (error == -EAGAIN) in xfs_qm_dquot_logitem_push()
166 spin_lock(&lip->li_ailp->ail_lock); in xfs_qm_dquot_logitem_push()
176 struct xfs_dquot *dqp = DQUOT_ITEM(lip)->qli_dquot; in xfs_qm_dquot_logitem_release()
203 struct xfs_dquot *dqp = DQUOT_ITEM(lip)->qli_dquot; in xfs_qm_dquot_logitem_precommit()
204 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_dquot_logitem_precommit()
209 fa = xfs_dquot_verify(mp, &ddq, dqp->q_id); in xfs_qm_dquot_logitem_precommit()
215 fa, dqp->q_id); in xfs_qm_dquot_logitem_precommit()
246 struct xfs_dq_logitem *lp = &dqp->q_logitem; in xfs_qm_dquot_logitem_init()
248 xfs_log_item_init(dqp->q_mount, &lp->qli_item, XFS_LI_DQUOT, in xfs_qm_dquot_logitem_init()
250 lp->qli_dquot = dqp; in xfs_qm_dquot_logitem_init()