Files
scoutfs/kmod/src/compact.h
T
Zach Brown 5f5729b2a4 scoutfs: add sticky compaction
As we write segments we're not limiting the number of segments they
intersect at the next level.  Compactions are limited to a fanout's
worth of overlapping segments.  This means that we can get a compaction
where the upper level segment overlapps more than the segments that are
part of the compaction.  In this case we can't write the remaining upper
level items at the lower level because now we can have a level with
segments whose keys intersect.

Instead we detect this compaction case.  We call it sticky because after
merging with the lower level segments the remaining items in the upper
level need to stick to the upper level.  The next time compaction comes
around it'll compact the remaining items with the additional lower
overlaping segments.

Signed-off-by: Zach Brown <zab@versity.com>
2017-06-27 14:04:38 -07:00

19 lines
653 B
C

#ifndef _SCOUTFS_COMPACT_H_
#define _SCOUTFS_COMPACT_H_
void scoutfs_compact_kick(struct super_block *sb);
void scoutfs_compact_describe(struct super_block *sb, void *data,
u8 upper_level, u8 last_level, bool sticky);
int scoutfs_compact_add(struct super_block *sb, void *data,
struct scoutfs_key_buf *first,
struct scoutfs_key_buf *last, u64 segno, u64 seq,
u8 level);
void scoutfs_compact_add_segno(struct super_block *sb, void *data, u64 segno);
int scoutfs_compact_commit(struct super_block *sb, void *c, void *r);
int scoutfs_compact_setup(struct super_block *sb);
void scoutfs_compact_destroy(struct super_block *sb);
#endif