Lines Matching defs:dq

59 	struct xfs_dquot	*dq,
75 error = xfs_bmapi_write(sc->tp, sc->ip, dq->q_fileoffset,
83 dq->q_blkno = XFS_FSB_TO_DADDR(mp, irec->br_startblock);
85 trace_xrep_dquot_item_fill_bmap_hole(sc->mp, dq->q_type, dq->q_id);
88 error = xfs_trans_get_buf(sc->tp, mp->m_ddev_targp, dq->q_blkno,
94 xfs_qm_init_dquot_blk(sc->tp, dq->q_id, dq->q_type, bp);
111 struct xfs_dquot *dq,
117 xfs_fileoff_t offset = dq->q_id / qi->qi_dqperchunk;
126 dq->q_fileoffset = offset;
134 error = xrep_quota_item_fill_bmap_hole(sc, dq, &irec);
141 } else if (dq->q_blkno != XFS_FSB_TO_DADDR(mp, irec.br_startblock)) {
147 dq->q_blkno = XFS_FSB_TO_DADDR(mp, irec.br_startblock);
175 struct xfs_dquot *dq)
193 xfs_dqunlock(dq);
195 xfs_dqlock(dq);
197 error = xrep_quota_item_bmap(sc, dq, &dirty);
203 if (dq->q_blk.softlimit > dq->q_blk.hardlimit) {
204 dq->q_blk.softlimit = dq->q_blk.hardlimit;
208 if (dq->q_ino.softlimit > dq->q_ino.hardlimit) {
209 dq->q_ino.softlimit = dq->q_ino.hardlimit;
213 if (dq->q_rtb.softlimit > dq->q_rtb.hardlimit) {
214 dq->q_rtb.softlimit = dq->q_rtb.hardlimit;
224 if (!xfs_has_reflink(mp) && dq->q_blk.count > mp->m_sb.sb_dblocks) {
225 dq->q_blk.reserved -= dq->q_blk.count;
226 dq->q_blk.reserved += mp->m_sb.sb_dblocks;
227 dq->q_blk.count = mp->m_sb.sb_dblocks;
232 if (dq->q_ino.count > fs_icount) {
233 dq->q_ino.reserved -= dq->q_ino.count;
234 dq->q_ino.reserved += fs_icount;
235 dq->q_ino.count = fs_icount;
239 if (dq->q_rtb.count > mp->m_sb.sb_rblocks) {
240 dq->q_rtb.reserved -= dq->q_rtb.count;
241 dq->q_rtb.reserved += mp->m_sb.sb_rblocks;
242 dq->q_rtb.count = mp->m_sb.sb_rblocks;
247 xrep_quota_item_timer(sc, &dq->q_blk, &dirty);
248 xrep_quota_item_timer(sc, &dq->q_ino, &dirty);
249 xrep_quota_item_timer(sc, &dq->q_rtb, &dirty);
254 trace_xrep_dquot_item(sc->mp, dq->q_type, dq->q_id);
256 dq->q_flags |= XFS_DQFLAG_DIRTY;
257 xfs_trans_dqjoin(sc->tp, dq);
258 if (dq->q_id) {
259 xfs_qm_adjust_dqlimits(dq);
260 xfs_qm_adjust_dqtimers(dq);
262 xfs_trans_log_dquot(sc->tp, dq);
264 xfs_dqlock(dq);
517 struct xfs_dquot *dq;
521 while ((error = xchk_dquot_iter(&cursor, &dq)) == 1) {
522 error = xrep_quota_item(&rqi, dq);
523 xfs_qm_dqput(dq);