usr.sbin/makefs: Add HAMMER2 offline PFS get|lookup|create|delete|snapshot support
commit3999233bff44d400850bbb7a09c35f31470f9a24
authorTomohiro Kusumi <tkusumi@netbsd.org>
Sat, 10 Jun 2023 08:12:06 +0000 (10 01:12 -0700)
committerTomohiro Kusumi <tkusumi@netbsd.org>
Sun, 11 Jun 2023 10:40:19 +0000 (11 03:40 -0700)
treeb1fbc1c494a66493e85970f574885f420f7c9626
parentb480790118e9c8d9e12b9daa855acc52ffea72c2
usr.sbin/makefs: Add HAMMER2 offline PFS get|lookup|create|delete|snapshot support

The offline PFS takes HAMMER2 specific "-o P" option.
`image-file` argument is a valid HAMMER2 image file or block device.
`directory` argument is unused, but needs to be a valid path or "--".

e.g.
$ makefs -t hammer2 -o P=get /dev/adx --
$ makefs -t hammer2 -o P=lookup:name /path/to/hammer2.img --
$ makefs -t hammer2 -o P=create:name /dev/adx --
$ makefs -t hammer2 -o P=delete:name /path/to/hammer2.img --
$ makefs -t hammer2 -o P=snapshot:name /dev/adx --
$ makefs -t hammer2 -o P=snapshot /path/to/hammer2.img --

The "-o P" option requires PFS command name argument, which are
"get" (alias "list"), "lookup", "create", "delete" and "snapshot".
lookup, create and delete take `:<pfs_name>` string after command name.
snapshot takes optional `:<pfs_name>` string after command name.

Use -m option (default "DATA") to specify target PFS for snapshot.
usr.sbin/makefs/hammer2.c
usr.sbin/makefs/hammer2.h
usr.sbin/makefs/hammer2/hammer2.h
usr.sbin/makefs/hammer2/hammer2_ioctl.c
usr.sbin/makefs/hammer2/hammer2_subr.c
usr.sbin/makefs/makefs.8