sys/vfs/hammer: Add vol_no field to struct hammer_ioc_volume
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 2 Apr 2016 19:05:44 +0000 (04:05 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 3 Apr 2016 02:48:23 +0000 (11:48 +0900)
commitea32fae4e76648969a69cc4eb674d70f9240998a
tree3d0ec31af113e257655fd71e4d8ef6dac7db6522
parent88ab73107ba3b29f833befced652d8f2c90a1568
sys/vfs/hammer: Add vol_no field to struct hammer_ioc_volume

The problem with interface/commands HAMMER provides is that there
is no way to know what the volume# is for each block device once
newfs_hammer is done, while error messages and manpages, etc talk
about the root volume without explaining what that really is.
In order to clearly show what the root volume is, userspace hammer
commands need to be able to retrieve relation between HAMMER
volume# and block device path, and then print the block device
with volume# 0.

e914c91d which added hammer volume-list command should have added
volume# field to the ioctl structure or at least assign reserved
space for future extension. This is basically the only ioctl that
can retrieve block device paths, but all it does is get the paths
without any other related information. This commit adds volume#
field to struct hammer_ioc_volume.

This commit affects HAMMERIOC_ADD_VOLUME, HAMMERIOC_DEL_VOLUME,
and HAMMERIOC_LIST_VOLUMES ioctls. These are only used by hammer
volume-add, volume-del, volume-list and volume-blkdevs commands.
This commit requires both /sbin/hammer and kernel rebuild.

Also see 7aee7a8b and dae8f186.
sys/vfs/hammer/hammer_ioctl.h
sys/vfs/hammer/hammer_volume.c