Skip to content

Commit

Permalink
Added orphan bit to xored-globals
Browse files Browse the repository at this point in the history
Unfortunately for us, even with the new ability to store global state,
orphans can not be handled as gracefully as moves. This is due to the
fact that directory operations can create an unbounded number of
orphans. It's usually small, the fact that it's unbounded means we can't
store the orphan info in xored-globals.

However, one thing we can do to leverage the xored-global state is store
a bit indicating if _any_ orphans are present. This means in the common
case we can completely avoid the deorphan step, while only using a
single bit of the global state, which is effectively free since we can
store it in the globals tag itself.

If a littlefs drive does not want to consider the orphan bit, it's free
to use the previous behaviour of always checking for orphans on first
write.
  • Loading branch information
geky committed Oct 16, 2018
1 parent 1a58ba7 commit 64df0a5
Show file tree
Hide file tree
Showing 2 changed files with 220 additions and 172 deletions.
Loading

0 comments on commit 64df0a5

Please sign in to comment.