9ns: Add fs_files and tree_files
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 1 Mar 2018 02:23:40 +0000 (21:23 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 30 Apr 2018 18:31:43 +0000 (14:31 -0400)
commit9dff4793be1706cfdf6b67d2266c6b76aab628bc
treed45d72bc83abf03338957bc093c9315e2176ef7b
parent73f4e7879bf2b259cc15190c0dd3510580c97418
9ns: Add fs_files and tree_files

fs_files are a basic structure that any 9ns device can use for a file
that contains data.  It's mostly a struct dir and a pagemap, though
future versions might not have a page mapping.  fs_files also come with
a set of operations, which will grow over time.

tree_files are fs_files that are arranged in a hierarchy consisting of
parents and children.  There are no hardlinks, but there are symlinks.
tree_files also come with a set of operations, which a device can use to
perform its role in operations such as lookups and creation.

Both fs_files and tree_files come with a collection of helper utilities,
such as fs_file_stat(), which a device can call.  The helpers handle the
various races and whatnot.

Devices do not need to use these at all, though my long term plan is to
replace all of the struct dirtabs with fs_files.  The dirtab is
basically a dir, but with the storage for the name built-in.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/include/fs_file.h [new file with mode: 0644]
kern/include/tree_file.h [new file with mode: 0644]
kern/src/ns/Kbuild
kern/src/ns/fs_file.c [new file with mode: 0644]
kern/src/ns/tree_file.c [new file with mode: 0644]