/* Look up the data fork mapping for the dquot id of interest. */
error = xfs_bmapi_read(cursor->quota_ip, fileoff,
XFS_MAX_FILEOFF - fileoff, &cursor->bmap, &nmaps, 0); if (error) return error; if (!nmaps) {
ASSERT(nmaps > 0); return -EFSCORRUPTED;
} if (cursor->bmap.br_startoff > fileoff) {
ASSERT(cursor->bmap.br_startoff == fileoff); return -EFSCORRUPTED;
}
/* Advance the dqiter cursor to the next non-sparse region of the quota file. */ STATICint
xchk_dquot_iter_advance_bmap( struct xchk_dqiter *cursor,
uint64_t *next_ondisk_id)
{ struct xfs_quotainfo *qi = cursor->sc->mp->m_quotainfo; struct xfs_ifork *ifp = xfs_ifork_ptr(cursor->quota_ip,
XFS_DATA_FORK);
xfs_fileoff_t fileoff;
uint64_t next_id; int nmaps = 1; int error;
/* Find the dquot id for the next non-hole mapping. */ do {
fileoff = cursor->bmap.br_startoff + cursor->bmap.br_blockcount; if (fileoff > XFS_DQ_ID_MAX / qi->qi_dqperchunk) { /* The hole goes beyond the max dquot id, we're done */
*next_ondisk_id = -1ULL; return0;
}
error = xfs_bmapi_read(cursor->quota_ip, fileoff,
XFS_MAX_FILEOFF - fileoff, &cursor->bmap,
&nmaps, 0); if (error) return error; if (!nmaps) { /* Must have reached the end of the mappings. */
*next_ondisk_id = -1ULL; return0;
} if (cursor->bmap.br_startoff > fileoff) {
ASSERT(cursor->bmap.br_startoff == fileoff); return -EFSCORRUPTED;
}
} while (!xfs_bmap_is_real_extent(&cursor->bmap));
next_id = cursor->bmap.br_startoff * qi->qi_dqperchunk; if (next_id > XFS_DQ_ID_MAX) { /* The hole goes beyond the max dquot id, we're done */
*next_ondisk_id = -1ULL; return0;
}
/* Propose jumping forward to the dquot in the next allocated block. */
*next_ondisk_id = next_id;
cursor->if_seq = ifp->if_seq;
trace_xchk_dquot_iter_advance_bmap(cursor, *next_ondisk_id); return0;
}
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.