btrfs-progs: libbtrfsutil: python: use top=0 as default value in SubvolumeIterator
diff mbox

Message ID 2bdae96a-ef14-2a86-ccc0-5eaf98c87fd2@jp.fujitsu.com
State New
Headers show

Commit Message

Misono Tomohiro April 17, 2018, 6:53 a.m. UTC
Document of SubvolumeIterator says:
  SubvolumeIterator(path, top=0, info=False, post_order=False)
    -> new subvolume iterator
  ...
  top -- if not zero, instead of only listing subvolumes beneath the
  given path, list subvolumes beneath the subvolume with this ID; passing
  BTRFS_FS_TREE_OBJECTID (5) here lists all subvolumes. The subvolumes
  are listed relative to the subvolume with this ID.
  ...

So, change the default value of @top from 5 to 0 accordingly.

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
 libbtrfsutil/python/subvolume.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox

diff --git a/libbtrfsutil/python/subvolume.c b/libbtrfsutil/python/subvolume.c
index 069e606b..6ecde1f6 100644
--- a/libbtrfsutil/python/subvolume.c
+++ b/libbtrfsutil/python/subvolume.c
@@ -525,7 +525,7 @@  static int SubvolumeIterator_init(SubvolumeIterator *self, PyObject *args,
 	static char *keywords[] = {"path", "top", "info", "post_order", NULL};
 	struct path_arg path = {.allow_fd = true};
 	enum btrfs_util_error err;
-	unsigned long long top = 5;
+	unsigned long long top = 0;
 	int info = 0;
 	int post_order = 0;
 	int flags = 0;