/* Commit new counters to a dquot. */ staticint
xqcheck_commit_dquot( struct xqcheck *xqc,
xfs_dqtype_t dqtype, struct xfs_dquot *dq)
{ struct xqcheck_dquot xcdq; struct xfarray *counts = xqcheck_counters_for(xqc, dqtype);
int64_t delta; bool dirty = false; int error = 0;
/* Unlock the dquot just long enough to allocate a transaction. */
xfs_dqunlock(dq);
error = xchk_trans_alloc(xqc->sc, 0);
xfs_dqlock(dq); if (error) return error;
xfs_trans_dqjoin(xqc->sc->tp, dq);
if (xchk_iscan_aborted(&xqc->iscan)) {
error = -ECANCELED; goto out_cancel;
}
mutex_lock(&xqc->lock);
error = xfarray_load_sparse(counts, dq->q_id, &xcdq); if (error) goto out_unlock;
/* Figure out quota CHKD flags for the running quota types. */ staticinlineunsignedint
xqcheck_chkd_flags( struct xfs_mount *mp)
{ unsignedint ret = 0;
if (XFS_IS_UQUOTA_ON(mp))
ret |= XFS_UQUOTA_CHKD; if (XFS_IS_GQUOTA_ON(mp))
ret |= XFS_GQUOTA_CHKD; if (XFS_IS_PQUOTA_ON(mp))
ret |= XFS_PQUOTA_CHKD; return ret;
}
/* Commit the new dquot counters. */ int
xrep_quotacheck( struct xfs_scrub *sc)
{ struct xqcheck *xqc = sc->buf; unsignedint qflags = xqcheck_chkd_flags(sc->mp); int error;
/* Commit the new counters to the dquots. */ if (xqc->ucounts) {
error = xqcheck_commit_dqtype(xqc, XFS_DQTYPE_USER); if (error) return error;
} if (xqc->gcounts) {
error = xqcheck_commit_dqtype(xqc, XFS_DQTYPE_GROUP); if (error) return error;
} if (xqc->pcounts) {
error = xqcheck_commit_dqtype(xqc, XFS_DQTYPE_PROJ); if (error) return error;
}
/* Set the CHKD flags now that we've fixed quota counts. */
error = xchk_trans_alloc(sc, 0); if (error) return error;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.