usr.sbin/makefs: Add HAMMER2 offline destroy support
commit917508cdbe01148ca55a70f784d29bf1d57b261d
authorTomohiro Kusumi <tkusumi@netbsd.org>
Thu, 8 Jun 2023 07:46:22 +0000 (8 00:46 -0700)
committerTomohiro Kusumi <tkusumi@netbsd.org>
Thu, 8 Jun 2023 10:52:12 +0000 (8 03:52 -0700)
tree2b97a11bb54285197bf1cef15d577bbf00e54f6e
parent3bbcb7430a58b04de1a1f01e3b2f1b2dc7d7671e
usr.sbin/makefs: Add HAMMER2 offline destroy support

The offline destroy takes HAMMER2 specific "-o D" 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 D=/a.out /dev/adx --
$ makefs -t hammer2 -o D=1234 /path/to/hammer2.img --

The "-o D" option reuires file path or inode number argument.
- If it's a file path, optarg must start with '/'.
- If it's an inum, optarg must start with "0x" or '0'-'9'.
Note that destroy by inum seems broken not only in makefs, but also
in real HAMMER2 ioctl.
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/makefs.8
usr.sbin/makefs/makefs.c
usr.sbin/makefs/walk.c