mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-10 13:47:27 +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>
12 lines
288 B
C
12 lines
288 B
C
#ifndef _BTREE_H_
|
|
#define _BTREE_H_
|
|
|
|
void btree_init_root_single(struct scoutfs_btree_root *root,
|
|
struct scoutfs_btree_block *bt,
|
|
u64 seq, u64 blkno);
|
|
|
|
void btree_append_item(struct scoutfs_btree_block *bt,
|
|
struct scoutfs_key *key, void *val, int val_len);
|
|
|
|
#endif
|