Lines Matching +full:wait +full:- +full:pin
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2003 Silicon Graphics, Inc.
54 qlf->qlf_type = XFS_LI_DQUOT; in xfs_qm_dquot_logitem_format()
55 qlf->qlf_size = 2; in xfs_qm_dquot_logitem_format()
56 qlf->qlf_id = qlip->qli_dquot->q_id; in xfs_qm_dquot_logitem_format()
57 qlf->qlf_blkno = qlip->qli_dquot->q_blkno; in xfs_qm_dquot_logitem_format()
58 qlf->qlf_len = 1; in xfs_qm_dquot_logitem_format()
59 qlf->qlf_boffset = qlip->qli_dquot->q_bufoffset; in xfs_qm_dquot_logitem_format()
62 xfs_dquot_to_disk(&ddq, qlip->qli_dquot); in xfs_qm_dquot_logitem_format()
69 * Increment the pin count of the given dquot.
75 struct xfs_dquot *dqp = DQUOT_ITEM(lip)->qli_dquot; in xfs_qm_dquot_logitem_pin()
78 atomic_inc(&dqp->q_pincount); in xfs_qm_dquot_logitem_pin()
82 * Decrement the pin count of the given dquot, and wake up
92 struct xfs_dquot *dqp = DQUOT_ITEM(lip)->qli_dquot; in xfs_qm_dquot_logitem_unpin()
94 ASSERT(atomic_read(&dqp->q_pincount) > 0); in xfs_qm_dquot_logitem_unpin()
95 if (atomic_dec_and_test(&dqp->q_pincount)) in xfs_qm_dquot_logitem_unpin()
96 wake_up(&dqp->q_pinwait); in xfs_qm_dquot_logitem_unpin()
100 * This is called to wait for the given dquot to be unpinned.
101 * Most of these pin/unpin routines are plagiarized from inode code.
108 if (atomic_read(&dqp->q_pincount) == 0) in xfs_qm_dqunpin_wait()
112 * Give the log a push so we don't wait here too long. in xfs_qm_dqunpin_wait()
114 xfs_log_force(dqp->q_mount, 0); in xfs_qm_dqunpin_wait()
115 wait_event(dqp->q_pinwait, (atomic_read(&dqp->q_pincount) == 0)); in xfs_qm_dqunpin_wait()
122 __releases(&lip->li_ailp->ail_lock) in xfs_qm_dquot_logitem_push()
123 __acquires(&lip->li_ailp->ail_lock) in xfs_qm_dquot_logitem_push()
125 struct xfs_dquot *dqp = DQUOT_ITEM(lip)->qli_dquot; in xfs_qm_dquot_logitem_push()
126 struct xfs_buf *bp = lip->li_buf; in xfs_qm_dquot_logitem_push()
130 if (atomic_read(&dqp->q_pincount) > 0) in xfs_qm_dquot_logitem_push()
137 * Re-check the pincount now that we stabilized the value by in xfs_qm_dquot_logitem_push()
140 if (atomic_read(&dqp->q_pincount) > 0) { in xfs_qm_dquot_logitem_push()
147 * here but wait for the flush to finish and remove the item from in xfs_qm_dquot_logitem_push()
155 spin_unlock(&lip->li_ailp->ail_lock); in xfs_qm_dquot_logitem_push()
162 } else if (error == -EAGAIN) in xfs_qm_dquot_logitem_push()
165 spin_lock(&lip->li_ailp->ail_lock); in xfs_qm_dquot_logitem_push()
175 struct xfs_dquot *dqp = DQUOT_ITEM(lip)->qli_dquot; in xfs_qm_dquot_logitem_release()
215 struct xfs_dq_logitem *lp = &dqp->q_logitem; in xfs_qm_dquot_logitem_init()
217 xfs_log_item_init(dqp->q_mount, &lp->qli_item, XFS_LI_DQUOT, in xfs_qm_dquot_logitem_init()
219 lp->qli_dquot = dqp; in xfs_qm_dquot_logitem_init()