Iniitialize segment header when writing item

Initialize the segment header as the items are written.  This isn't a
great place to do it.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2016-12-08 08:53:56 -08:00
parent 48f9be8455
commit 07ba01f6b0

View File

@@ -474,6 +474,10 @@ void scoutfs_seg_first_item(struct super_block *sb, struct scoutfs_segment *seg,
u32 key_off;
u32 val_off;
/* XXX the segment block header is a mess, be better */
sblk->segno = cpu_to_le64(seg->segno);
sblk->max_seq = cpu_to_le64(1);
key_off = pos_off(seg, nr_items);
val_off = key_off + key_bytes;