summaryrefslogtreecommitdiff
path: root/libbtrfsutil/python/module.c
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2018-01-18 14:26:35 -0800
committerDavid Sterba <dsterba@suse.com>2018-03-06 11:28:37 +0100
commit678da5a7f71ed7fbc887e40cc8ef91008c6fe843 (patch)
tree1a2f01608affa5b7b4a9cd91976996c82450044a /libbtrfsutil/python/module.c
parentcfa89b30821fedb48ca163a9c1128c4db596c911 (diff)
libbtrfsutil: add btrfs_util_delete_subvolume()
We also support recursive deletion using a subvolume iterator. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'libbtrfsutil/python/module.c')
-rw-r--r--libbtrfsutil/python/module.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbtrfsutil/python/module.c b/libbtrfsutil/python/module.c
index 3f0f6170..fe25f4b7 100644
--- a/libbtrfsutil/python/module.c
+++ b/libbtrfsutil/python/module.c
@@ -227,6 +227,14 @@ static PyMethodDef btrfsutil_methods[] = {
"read_only -- create a read-only snapshot\n"
"async -- create the subvolume without waiting for it to commit to\n"
"disk and return the transaction ID"},
+ {"delete_subvolume", (PyCFunction)delete_subvolume,
+ METH_VARARGS | METH_KEYWORDS,
+ "delete_subvolume(path, recursive=False)\n\n"
+ "Delete a subvolume or snapshot.\n\n"
+ "Arguments:\n"
+ "path -- string, bytes, or path-like object\n"
+ "recursive -- if the given subvolume has child subvolumes, delete\n"
+ "them instead of failing"},
{},
};