sys/vfs/hammer: Ask before reblocking on volume-del
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 3 Apr 2016 20:48:44 +0000 (05:48 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 4 Apr 2016 02:17:13 +0000 (11:17 +0900)
commit1d1199eb3292602cdbf3f5dee333eba434fd67d0
treefba7ebc08741006cb9aad5044da3c32a2321cef0
parent778c2d2c0cce2142a5d08710aab562f7bebca848
sys/vfs/hammer: Ask before reblocking on volume-del

hammer volume-del finishes instantly if the volume doesn't need
reblocking, but it could take long depending on how much of the
big-blocks within the volume is used.

This commit makes hammer volume-del ask y/n whether to start
reblocking or not if the volume wasn't empty. Using force option
(-F) makes it reblock without asking.

Also note that reblocking doesn't guarantee anything on removing
a volume from filesystem. It just tries to move data to other
volume(s) so the volume may become empty. Thus users should have
choice.

 # hammer volume-del /dev/da2 /HAMMER
 /dev/da2 is not empty, do you want to reblock /dev/da2? [y/n]
 n
 hammer volume-del ioctl: Directory not empty
sbin/hammer/cmd_volume.c
sys/vfs/hammer/hammer_ioctl.h
sys/vfs/hammer/hammer_volume.c