]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/utils.c
lxc-destroy: remove btrfs subvolumes
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 28 Apr 2015 13:31:05 +0000 (13:31 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 26 May 2015 15:14:22 +0000 (11:14 -0400)
commit4295c5de9ed4b2e857cf2d981b4de8188bf2de2e
treeb78cf80afae4a03d14a77709a2f0ffae560c676c
parent0f541e331323cc18e30a219650b16a1488a0a137
lxc-destroy: remove btrfs subvolumes

Doing this requires some btrfs functions from bdev to be used in
utils.c  Because utils.h is imported by lxc_init.c, I had to create
a new initutils.[ch] which are used by both lxc_init.c and utils.c
We could instead put the btrfs functions into utils.c, which would
be a shorter patch, but it really doesn't belong there.  So I went
the other way figuring there may be more such cases coming up of
fns in utils.c needing code from bdev.c which can't go into lxc_init.

Currently, if we detect a btrfs subvolume we just remove it.  The
st_dev on that dir is different, so we cannot detect if this is
bound in from another fs easily.  If we care, we should check
whether this is a mountpoint, this patch doesn't do that.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/Makefile.am
src/lxc/bdev.c
src/lxc/bdev.h
src/lxc/initutils.c [new file with mode: 0644]
src/lxc/initutils.h [new file with mode: 0644]
src/lxc/lxc_init.c
src/lxc/utils.c
src/lxc/utils.h