Commit Graph

14 Commits

Author SHA1 Message Date
Zach Brown
932a842ae3 Remove valid_bytes from stat _more ioctls
The idea here was that we'd expand the size of the struct and
valid_bytes would tell the kernel which fields were present in
userspace's struct.  That doesn't combine well with the ioctl convention
of having the size of the type baked into the ioctl number.   We'll
remove this to make the world less surprising.  If we expand the
interface we'd add additional ioctls and types.

Signed-off-by: Zach Brown <zab@versity.com>
2021-10-28 12:30:47 -07:00
Zach Brown
46edf82b6b Add inode crtime creation time
Add an inode creation time field.  It's created for all new inodes.
It's visible to stat_more.  setattr_more can set it during
restore.

Signed-off-by: Zach Brown <zab@versity.com>
2021-09-03 11:14:41 -07:00
Andy Grover
d48b447e75 Do not set -Wpadded except for checking kmod-shared headers
Remove now-unneeded manual padding in arg structs.

Signed-off-by: Andy Grover <agrover@versity.com>
2021-01-12 16:29:42 -08:00
Andy Grover
e0a2175c2e Use argp info instead of duplicating for cmd_register()
Make it static and then use it both for argp_parse as well as
cmd_register_argp.

Split commands into five groups, to help understanding of their
usefulness.

Mention that each command has its own help text, and that we are being
fancy to keep the user from having to give fs path.

Signed-off-by: Andy Grover <agrover@versity.com>
2021-01-12 16:29:42 -08:00
Andy Grover
68b8e4098d Implement argp support for stat and statfs
Signed-off-by: Andy Grover <agrover@versity.com>
2021-01-04 11:49:31 -08:00
Zach Brown
36c426d555 scoutfs-utils: add total m/d blocks to statfs
Signed-off-by: Zach Brown <zab@versity.com>
2020-10-26 15:19:41 -07:00
Zach Brown
1e2dc6c1df scoutfs-utils: add committed_seq to statfs_more
Signed-off-by: Zach Brown <zab@versity.com>
2020-08-26 14:39:28 -07:00
Zach Brown
70efa2f905 scoutfs-utils: add statfs wrapper
Add a scoutfs command wrapper around the statfs_moe ioctl.  It's the
same as the stat_more ioctl but has different fields and a different
ioctl.

Signed-off-by: Zach Brown <zab@versity.com>
2019-08-20 15:52:17 -07:00
Zach Brown
ac1065014b scoutfs-utils: add stat -s option
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>
2018-02-21 09:36:49 -08:00
Zach Brown
02204c36fc scoutfs-utils: clean up 'stat' output
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>
2018-02-21 09:36:49 -08:00
Zach Brown
d796fbf15e scoutfs: track online and offline blocks
Signed-off-by: Zach Brown <zab@versity.com>
2018-02-21 09:36:49 -08:00
Mark Fasheh
7df8b87128 scoutfs-utils: cmd_register - pass a parsing friendly argv
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>
2017-11-28 14:47:50 -08:00
Zach Brown
228c5d8b4b scoutfs-utils: support meta and data seqs
Signed-off-by: Zach Brown <zab@versity.com>
2017-05-23 12:17:52 -07:00
Zach Brown
08aaa5b430 scoutfs-utils: add stat command
The scoutfs stat command is modeled after stat(1) and uses the STAT_MORE
ioctl.

Signed-off-by: Zach Brown <zab@versity.com>
2017-05-23 12:17:50 -07:00