usr.sbin/makefs/hammer2: Support recursive read for "-o R" option
authorTomohiro Kusumi <tkusumi@netbsd.org>
Tue, 27 Jun 2023 08:25:15 +0000 (01:25 -0700)
committerTomohiro Kusumi <tkusumi@netbsd.org>
Fri, 30 Jun 2023 15:20:27 +0000 (08:20 -0700)
commit5e8b0eb766966577a1da788053d7ccaa443fa222
treeb129823037bbd4fc69bbf0aeaa7ed0a67505c2d4
parent9d036237cbc59969257aaea138ddec5dbd8e181b
usr.sbin/makefs/hammer2: Support recursive read for "-o R" option

"-o R" option currently creates 0 byte file if a given path is
a directory, as directory inode size is set to 0.

Change this to recursively walk directories, and retrieve directories
and regular files under that directory. Specifying "-o R=/" does
the reverse of what makefs(8) does.

It currently has following limitations.
- Only directory and regular file are supported, other types are ignored.
- Hard links are not ignored, but files are retrieved as different inodes
 and link count is not preserved.
- Inode timestamp is not preserved.
- Anything that HAMMER2 and this option support, but underlying
 file system doesn't is unsupported.
usr.sbin/makefs/hammer2.c
usr.sbin/makefs/hammer2/hammer2.h
usr.sbin/makefs/hammer2/hammer2_buf.c
usr.sbin/makefs/hammer2/hammer2_compat.h
usr.sbin/makefs/hammer2/hammer2_vnops.c
usr.sbin/makefs/makefs.8