From patchwork Tue Apr 17 06:53:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Misono Tomohiro X-Patchwork-Id: 10344425 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2325060216 for ; Tue, 17 Apr 2018 06:53:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12D2427F97 for ; Tue, 17 Apr 2018 06:53:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05CFB289BC; Tue, 17 Apr 2018 06:53:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7C8027F97 for ; Tue, 17 Apr 2018 06:53:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752086AbeDQGxc (ORCPT ); Tue, 17 Apr 2018 02:53:32 -0400 Received: from mgwym04.jp.fujitsu.com ([211.128.242.43]:11577 "EHLO mgwym04.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751147AbeDQGxb (ORCPT ); Tue, 17 Apr 2018 02:53:31 -0400 Received: from yt-mxauth.gw.nic.fujitsu.com (unknown [192.168.229.68]) by mgwym04.jp.fujitsu.com with smtp id 6872_9a04_079ac003_1d00_4310_8c75_ff82b7decbf6; Tue, 17 Apr 2018 15:53:25 +0900 Received: from g01jpfmpwkw03.exch.g01.fujitsu.local (g01jpfmpwkw03.exch.g01.fujitsu.local [10.0.193.57]) by yt-mxauth.gw.nic.fujitsu.com (Postfix) with ESMTP id 0CEF2AC00C7 for ; Tue, 17 Apr 2018 15:53:25 +0900 (JST) Received: from G01JPEXCHKW15.g01.fujitsu.local (G01JPEXCHKW15.g01.fujitsu.local [10.0.194.54]) by g01jpfmpwkw03.exch.g01.fujitsu.local (Postfix) with ESMTP id 64185BD66E1 for ; Tue, 17 Apr 2018 15:53:24 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.5.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20170217-enc X-SHieldMailCheckerMailID: 1c6a55543b8e4e7a846ae03b2b29df8b From: Misono Tomohiro Subject: [PATCH] btrfs-progs: libbtrfsutil: python: use top=0 as default value in SubvolumeIterator To: linux-btrfs Message-ID: <2bdae96a-ef14-2a86-ccc0-5eaf98c87fd2@jp.fujitsu.com> Date: Tue, 17 Apr 2018 15:53:06 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Language: en-US X-SecurityPolicyCheck-GC: OK by FENCE-Mail X-TM-AS-MML: disable Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- libbtrfsutil/python/subvolume.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;