Move the magic value that identifies the super block into the block
header and use it for btree blocks as well.
Signed-off-by: Zach Brown <zab@versity.com>
Make the changes to support the new small key struct. mkfs and print
work with simpler keys, segment items, and manifest entries. The item
cache keys ioctl now just needs to work with arrays of keys.
Signed-off-by: Zach Brown <zab@versity.com>
scoutfs now directly uses the kernel dlm subsystem and offsers a debugfs
file with the current lock state. We don't need userspace to read and
format the contents of a debugging file.
Signed-off-by: Zach Brown <zab@versity.com>
With the removal of the size index items we no longer have to print them
or be able to walk the index. mkfs only needs to create a meta seq
index item for the root inode.
Signed-off-by: Zach Brown <zab@versity.com>
This command takes a device and dumps all dlmglue locks and their state to
the console. It also computes some average lock wait times. We provide a
couple of options:
--lvbs=[yes|no] turns on or off printing of lvb data (default is off)
--oneline provides a more concise per-lock printout.
Signed-off-by: Mark Fasheh <mfasheh@versity.com>
We were chopping off the command string when passing the argument array into
registered commands. getopt expects a program name as the first argument, so
change cmd_execute() to only chop off the scoutfs program name now. Now we
can parse command arguments in an easy and standard manner.
This necessitates a small update of each commands usage of argv/argc.
Signed-off-by: Mark Fasheh <mfasheh@versity.com>
Our item cache protocol is tied to holding DLM locks which cover a
region of the item namespace. We want locks to cover all the data
associated with an inode and other locks to cover the indexes. So we
resort the items first by major (index, fs) then by inode type (inode,
dirent, etc).
Signed-off-by: Zach Brown <zab@versity.com>
Manifest entries and segment allocation bitmap regions are now stored in
btree items instead of the ring log. This lets us work with them
incrementally and share them between nodes.
Signed-off-by: Zach Brown <zab@versity.com>
Just lift the key printer from the kernel and use it to print
item keys in segments and in manifest entries.
Signed-off-by: Zach Brown <zab@versity.com>
Add support for the inode index items which are replacing the seq walks
from the old btree structures. We create the index items for the root
inode, can print out the items, and add a commmand to walk the indices.
Signed-off-by: Zach Brown <zab@versity.com>
It's a bit confusing to always see both the old and current super block.
Let's only print the first one. We could add an argument to print all
of them.
Signed-off-by: Zach Brown <zab@versity.com>
Add mkfs and print support for the simpler rings that the segment bitmap
allocator and manifest are now using. Some other recent format header
updates come along for the ride.
Signed-off-by: Zach Brown <zab@versity.com>
The segment item struct used to have fiddly packed offsets and lengths.
Now it's just normal fields so we can work with them directly and get
rid of the native item indirection.
Signed-off-by: Zach Brown <zab@versity.com>
We were using a bitmap to record segments during manifest printing and
then walking that bitmap to print segments. It's a little silly to have
a second data structure record the referenced segments when we could
just walk the manifest again to print the segments.
So refactor node printing into a treap walker that calls a function for
each node. Then we can have functions that print the node data
structurs for each treap and then one that prints the segments that are
referenced by manifest nodes.
Signed-off-by: Zach Brown <zab@versity.com>
Update mkfs and print to describe the ring blocks with a starting index
and number of blocks instead of a head and tail index.
Signed-off-by: Zach Brown <zab@versity.com>