Changed lookahead configuration unit to bytes instead of bits

The fact that the lookahead buffer uses bits instead of bytes is an
internal detail. Poking this through to the user API has caused a decent
amount of confusion. Most buffers are provided as bytes and the
inconsistency here can be surprising.

The use of bytes instead of bits also makes us forward compatible in
the case that we want to change the lookahead internal representation
(hint segment list).

Additionally, we change the configuration name to lookahead_size. This
matches other configurations, such as cache_size and read_size, while
also notifying the user that something important changed at compile time
(by breaking).
This commit is contained in:
Christopher Haster
2018-10-02 20:18:30 -05:00
parent ad96fca18f
commit 7af8b81b81
5 changed files with 41 additions and 37 deletions

View File

@@ -49,7 +49,8 @@ const struct lfs_config cfg = {
.prog_size = 16,
.block_size = 4096,
.block_count = 128,
.lookahead = 128,
.cache_size = 16,
.lookahead_size = 16,
};
// entry point