[PATCH 06/10] audit: Factor out chunk replacement code