modify write_to_block() API.