Commit Graph

10 Commits

Author SHA1 Message Date
Zach Brown
4b182c7759 scoutfs: insert manifest nodes into blkno radix
We had forgotten to actually insert manifest nodes in to the blkno
radix.  This hasn't mattered yet because there's only been one manifest
in the level 0 list.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-29 18:21:54 -08:00
Zach Brown
16abddb46a scoutfs: add basic segment reading
Add the most basic ability to read items from log segment blocks.  If
an item isn't in the cache then we walk segments in the manifest and
check for the item in each one.

This is just the core fundamental code.  There's still a lot to do:
basic corruption validation, multi-block segments, bloom filters and
arrays to optimize segment misses, and some day the ability to read file
data items directly into page cache pages.  The manifest locking is also
super broken.

But this is enough to let us mount and stat the root inode!

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-28 17:45:44 -08:00
Zach Brown
8604c85486 scoutfs: add basic reing replay on mount
Read the ring described by the super block and replay its entries to
rebuild the in-memory state of the chunk allocator and log segment
manifest.

We add just enough of the chunk allocator to set the free bits to the
contents of the ring bitmap entries.

We start to build out the basic manifest data structure.  It'll
certainly evolve when we later add code to actually query it.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-26 17:00:19 -08:00
Zach Brown
28521e8c45 scoutfs: add block read helper
Add a trivial helper function which verifies the block header in
metadata blocks.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-23 21:13:56 -08:00
Zach Brown
71df879f07 scoutfs: update format.h to remove bricks
Update to the format.h from the recent -utils changes that moved from
the clumsy 'brick' terminology to the more reasonable
'block/chunk/segment' terminology.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-23 19:39:02 -08:00
Zach Brown
6686ca191a scoutfs: remove the prototype log writing
The sync implementation was a quick demonstration of packing items in to
large log blocks.  We'll be doing things very differently in the actual
system.  So tear this code out so we can build up more functional
structures.  It'll still be in revision control so we'll be able
to reuse the parts that make sense in the new code.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-23 19:33:56 -08:00
Zach Brown
3483133cdf Read super brick instead of mkfs
Now that we have a working userspace mkfs we can read the supers on
mount instead of always initializing a new file system.  We still don't
know how to read items from blocks so mount fails when it can't find the
root dir inode.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-12 19:37:48 -08:00
Zach Brown
82ec91d1e0 Update format to recent utils changes
The format was updated while implementing mkfs and print in
scoutfs-utils.  Bring the kernel code up to speed.

For some reason I changed the name of the item length in the item header
struct.  Who knows.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-12 19:32:53 -08:00
Zach Brown
eb4694e401 Add simple message printing
Add a message printing function whose output includes the device and
major:minor and which handles the kernel level string prefix.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-12 19:28:03 -08:00
Zach Brown
25a1e8d1b7 Initial commit
This is the initial commit of the repo that will track development
against distro kernels.

This is an import of a prototype branch in the upstream kernel that only
had a few initial commits.  It needed to move to the old readdir
interface and use find_or_create_page() instead of pagecache_get_page()
to build in older distro kernels.
2016-02-05 14:12:14 -08:00