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