Move flush functions to flush.c.