Removed xored-globals from the mdir struct

The xored-globals have a very large footprint. In the worst case, the
xored-globals are stored on each metadata-pair, twice in memory. They
must be very small, but are also very useful, so at risk of growing
in the future (hint global free-list?).

Initially we also stored a copy in each mdir structure, since this
avoided extra disk access to look up the globals when we need to modify
the global state on a metadata-pair. But we can easily just fetch the
globals when needed.

This is more costly in terms of runtime, but reduces RAM impact of
globals, which was previously needed for each open dir and file.
This commit is contained in:
Christopher Haster
2018-09-12 01:34:03 -05:00
parent 5eeeb9d6ac
commit 7bacf9b1e0
2 changed files with 108 additions and 97 deletions

1
lfs.h
View File

@@ -315,7 +315,6 @@ typedef struct lfs_mdir {
bool erased;
bool split;
lfs_block_t tail[2];
lfs_global_t locals;
} lfs_mdir_t;
// littlefs directory type