mkfs needs to make sure that a device is large enough for a file system.
We had a tiny limit that almost certainly wouldn't have worked.
Increase the limit to a still absurdly small but arguably possible 16
segments.
Signed-off-by: Zach Brown <zab@versity.com>
Update the format header and add a man page which describes the
corruption messages that the kernel module can spit out.
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>
Lots of tests run scout stat and parse a single value. Give them an
option to have the only output be that value so they don't have to pull
it out of the output.
Signed-off-by: Zach Brown <zab@versity.com>
The previous formatting was modeled after the free form 'stat' output
and it's a real mess. Just make it a simple "name value" table.
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>
Update the calculation of the largest number of btree blocks based on
the format.h update that provides the min free space in parent blocks
instead of the free limit for the entire block.
Signed-off-by: Zach Brown <zab@versity.com>
The kernel format.h has built up some changes that the userspace utils
don't use. We're about to start enforcing exact matching of the source
files at run time so let's bring these back in sync.
Signed-off-by: Zach Brown <zab@versity.com>
The kernel key printing code was refactored to more carefully print
keys. Import this updated code by adding supporting functions around it
so that we don't have to make edits to it and can easily update the
import in the future.
Signed-off-by: Zach Brown <zab@versity.com>
format.h and ioctl.h are copied from the kernel module. It had a habit
of accidentally using types that aren't exported to userspace. It's
since added build checks that enforce exported types. This copies the
fixed use of exported types over for hopefully the last time.
Signed-off-by: Zach Brown <zab@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>
Recent kernel headers have leaked __bitwise into userspace. Rename our
use of __bitwise in userspace sparse builds to avoid the collision.
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>