git: sys/vfs/hammer: Ask before reblocking on volume-del

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sun Apr 3 22:52:17 PDT 2016


commit 1d1199eb3292602cdbf3f5dee333eba434fd67d0
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Mon Apr 4 05:48:44 2016 +0900

    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

Summary of changes:
 sbin/hammer/cmd_volume.c       | 18 +++++++++++++++---
 sys/vfs/hammer/hammer_ioctl.h  |  5 ++++-
 sys/vfs/hammer/hammer_volume.c |  7 ++++++-
 3 files changed, 25 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1d1199eb3292602cdbf3f5dee333eba434fd67d0


-- 
DragonFly BSD source repository



More information about the Commits mailing list