Skip to content

Commit

Permalink
Reduce block size for volatile storage
Browse files Browse the repository at this point in the history
With a larger block size, entire blocks are taken by empty or near-empty directories, which leads to out of space errors even though the filesystem is mostly empty.

Partially fix #283
  • Loading branch information
sosthene-nitrokey committed Jun 13, 2023
1 parent 656f7ef commit 29fc3f5
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion runners/embedded/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,22 @@ impl apps::Runner for Runner {
}

// 8KB of RAM
const_ram_storage!(VolatileStorage, 8192);
const_ram_storage!(
name = VolatileStorage,
trait = LfsStorage,
erase_value = 0xff,
read_size = 16,
write_size = 256,
cache_size_ty = littlefs2::consts::U256,
/// We use 256 instead of the default 512 to avoid loosing too much space to nearly empty blocks containing only folder metadata.
block_size = 256,
block_count = 8192/256,
lookahead_size_ty = littlefs2::consts::U1,
filename_max_plus_one_ty = littlefs2::consts::U256,
path_max_plus_one_ty = littlefs2::consts::U256,
result = LfsResult,
);


store!(
RunnerStore,
Expand Down

0 comments on commit 29fc3f5

Please sign in to comment.