Squished in-flight files/dirs into single list

This is an effort to try to consolidate the handling of in-flight files
and dirs opened by the user (and possibly opened internally). Both files
and dirs have metadata state that need to be kept in sync by the commit
logic.

This metadata state is mostly contained in the lfs_mdir_t type, which is
present in both the lfs_file_t and lfs_dir_t. Unfortunately both of
these structs have some relatively unrelated metadata that needs to be
kept in sync:
- Files store an id representing the open file
- Dirs store an id during iteration

While these take up the same space, they unfortunately need to be
managed differently by the commit logic.

The best solution I can come up with is to simple store a general
purpose list and tag both structures with LFS_TYPE_REG and LFS_TYPE_DIR
respectively. This is kinda funky, but wins out over duplicated the
commit logic.
This commit is contained in:
Christopher Haster
2018-08-01 10:24:59 -05:00
parent bd1e0c4059
commit 35f68d28cc
2 changed files with 472 additions and 456 deletions

883
lfs.c

File diff suppressed because it is too large Load Diff