Implement flush_dirty_pages method