Combined superblock scan and fetch of xored-globals during mount

Conceptually these are two separate operations. However, they are both
only needed during mount, both require iteration over the linked-list of
metadata-pairs, and both are independent from each other.

Combining these into one gives us a nice code savings.

Additionally, this greatly simplifies the lookup of the root directory.
Initially we used a flag to indicate which superblock was root, since we
didn't want to fetch more pairs than we needed to. But since we're going
to fetch all metadata-pairs anyways, we can just use the last superblock
we find as the indicator of our root directory.
This commit is contained in:
Christopher Haster
2018-09-12 01:50:21 -05:00
parent 7bacf9b1e0
commit cf87ba5375
3 changed files with 80 additions and 86 deletions

View File

@@ -7,7 +7,6 @@ TYPES = {
(0x1ff, 0x002): 'reg',
(0x1ff, 0x003): 'dir',
(0x1ff, 0x001): 'superblock',
(0x1ff, 0x000): 'root',
(0x1ff, 0x020): 'delete',
(0x1f0, 0x0e0): 'globals',
(0x1ff, 0x080): 'tail soft',