mirror of
https://github.com/versity/scoutfs.git
synced 2026-06-01 09:16:21 +00:00
scoutfs mkfs had two block writing functions: write_block to fill out some block header fields including crc calculation, and then write_block_raw to pwrite the raw buffer to the bytes in the device. These were used inconsistenly as blocks came and went over time. Most callers filled out all the header fields themselves and called the raw writer. write_block was only used for super writing, which made sense because it clobbered the block's header with the super header so the caller's set header magic and seq fields would be lost. This cleans up the mess. We only have one block writer and the caller provides all the hdr fields. Everything uses it instead of filling out the fields themselves and calling the raw writer. Signed-off-by: Zach Brown <zab@versity.com>