document the libufs interface for fetching and storing inodes.
The undocumented getino / putino interface has been replaced
with a new getinode / putinode interface.
Convert the utilities that had been using the undocumented
interface to use the new documented interface.
No functional change (as for now the libufs library does not
do inode check-hashes).
Reviewed by: kib
Tested by: Peter Holm
Sponsored by: Netflix
to fit in only direct blocks whose size is exactly a multiple of the
filesystem block size.
Reported by: Peter Holm
Tested by: Peter Holm
Sponsored by: Netflix
block followed by a discontiguous fragment.
Add checks for unallocated inodes and inodes with unknown mode
types.
Cleanup variable declarations by changing from type `int' to types
like ufs_lbn_t, ufs2_daddr_t, etc.
Reported by: bde
prtblknos filesystem_device inode ...
add an additional argument format:
prtblknos file
which is more convenient than figuring out the filesystem
and inode number for "file".
When given a list of multiple inodes, rather than exiting
the program on an error with one of them, skip over it and
continue with the next one.
Submitted by: bde
regular files, directories, and symbolic links that require
external storage.
Correct the handling of files with holes and files that have
one or more large blocks and end with a fragment.
Reported by: bde
main.c - opens disk and processes the argument list
of inodes to be printed
prtblknos.c - prints out the list of blocks used by an inode
This change allows the fsdb program to import prtblknos() to use when
printing out the set of blocks used by an inode.
This program was switched to using the libufs library to ease its
integration with fsdb and any other filesystem utility that might
want to use it in the future.
of blocks used by a requested list of inodes.
For example, to list the blocks referenced by your kernel:
guest_12 % df /
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/gpt/rootfs 20307196 10707336 7975288 57% /
guest_12 % ls -i /boot/kernel/kernel
160603 /boot/kernel/kernel
guest_12 % ./prtblknos /dev/gpt/rootfs 160603
160603: lbn 0-7 blkno 3217584-3217647
lbn 8-11 blkno 3217864-3217895 distance 216
First-level indirect, blkno 3217896-3217903 distance 0
lbn 12-19 blkno 3217904-3217967 distance 8
lbn 20-75 blkno 3251816-3252263 distance 33848
lbn 76-83 blkno 3252368-3252431 distance 104
lbn 84-91 blkno 3252464-3252527 distance 32
lbn 92-852 blkno 3252896-3258983 distance 368
Each contiguous range of blocks is printed on a line.
The distance metric is the size of the gap from the end of the
previous set of blocks to the beginning of the next set of blocks.
Short distances are desirable.