diff options
author | Christopher Haster <chaster@utexas.edu> | 2018-09-15 06:02:39 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2018-10-18 18:00:49 +0300 |
commit | 29b881017df353bb8a387fb59832c34a802db761 (patch) | |
tree | 78ff2132b0314bd82b26b8f90515099b312f63e8 /lfs.h | |
parent | cf87ba537598d13b0884751bee8d4ad71e782450 (diff) |
Revisited xored-globals and related logic
Added separate bit for "hasmove", which means we don't need to check
the move id, and allows us to add more sync-related global states in
the future, as long as they never happen simultaneously (such as
orphans and moves).
Also refactored some of the logic and removed the union in the global
structure, which didn't really add anything of value.
Diffstat (limited to 'lfs.h')
-rw-r--r-- | lfs.h | 23 |
1 files changed, 7 insertions, 16 deletions
@@ -290,20 +290,6 @@ typedef struct lfs_cache { uint8_t *buffer; } lfs_cache_t; -typedef union lfs_global { - uint32_t u32[3]; - struct { - lfs_block_t movepair[2]; - uint16_t moveid; - uint8_t deorphaned; - } l; - struct { - lfs_block_t movepair[2]; - uint16_t moveid; - uint8_t orphans; - } g; -} lfs_global_t; - typedef struct lfs_mdir { lfs_block_t pair[2]; uint32_t rev; @@ -373,8 +359,13 @@ typedef struct lfs { } *mlist; uint32_t seed; - lfs_global_t globals; - lfs_global_t locals; + struct lfs_globals { + lfs_block_t pair[2]; + uint16_t id; + bool hasmove; + uint8_t orphans; + } globals, locals; + struct lfs_free { lfs_block_t off; lfs_block_t size; |