`State` carried four loose fields for open files:
- the write state by inode;
- the inode behind each handle;
- the inodes being released;
- the next handle number.
Eleven modules read and changed them directly. The release callback did
the reference counting by hand. Finding unsaved changes meant chaining two
of the maps in two places.
`pdfs_vfs::open::OpenFiles` now owns them. It opens a writer and returns
the handle number, looks a writer up by inode or by handle, and says
whether an inode is busy or owes changes. It hands back the write state
on the last release, and marks the inode as releasing until
`finish_release`. One counter still serves file and directory handles.
The FUSE adapter and the rest of `pdfs-fuse` call these methods. There
is no behaviour change.
`pending`, `hidden` and `self_changes` move off `Core` into
`writes::WriteState`. The read path, listings, the pin keeper and the event
feed now ask it through methods (`queued`, `is_queued`, `queued_len`,
`queued_sizes`, `hidden`, `hide`, `unhide`, `note_echo`, `take_echo`)
instead of taking its locks. `hidden` and `self_changes` are private to the
module. `pending` stays visible to the queue, the drain and recovery, which
update it together with the database under one lock.
- resolve.rs: finding nodes by path or uid, in the tree, the database and
on Drive (15 methods).
- remote.rs: renames, moves and content changes sent straight to Drive
(6 methods).
- requests.rs: the control socket's requests by path: list, open,
rename, move, copy, delete, restore a replaced file (25 methods).
- activity.rs: the activity log (2 methods).
No behaviour changes.