From patchwork Tue Oct 8 03:41:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 3000081 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 941749F243 for ; Tue, 8 Oct 2013 03:34:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C66642018C for ; Tue, 8 Oct 2013 03:34:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCC24201BA for ; Tue, 8 Oct 2013 03:34:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752717Ab3JHDeV (ORCPT ); Mon, 7 Oct 2013 23:34:21 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:17815 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752579Ab3JHDeR (ORCPT ); Mon, 7 Oct 2013 23:34:17 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r983YCbh011512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Oct 2013 03:34:13 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r983YBx6029546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 8 Oct 2013 03:34:12 GMT Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71]) by userz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r983YBVP003471; Tue, 8 Oct 2013 03:34:11 GMT Received: from wish.sg.oracle.com (/10.186.101.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Oct 2013 20:34:11 -0700 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH 2/3 v2] btrfs-progs: add more parameter to the filesystem show Date: Tue, 8 Oct 2013 11:41:39 +0800 Message-Id: <1381203700-17558-2-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 1.8.1.164.g2d0029e In-Reply-To: <1381203700-17558-1-git-send-email-anand.jain@oracle.com> References: <1381203700-17558-1-git-send-email-anand.jain@oracle.com> X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP for mounted btrfs filesystem this patch proposes to add mount point and group profile to the filesystem show output. this helps user to quickly understand short details of the btrfs filesystem quickly. end user using this new btrfs fi show would surely notice this will reduce other commands normally used following the current btrfs fi show command. (like mount and btrfs fi df). of course user should use fi df to know detailed info about the sizes. preview as below.. Label: none uuid: 26d539a5-8968-4cf0-b4b5-5fd50105f8a0 mounted: /btrfs Group profile: Metadata: single Metadata: DUP Data: single Total devices 1 FS bytes used 28.00KiB devid 1 size 1.98GiB used 238.25MiB path /dev/mapper/mpatha v2: commit message edited. Signed-off-by: Anand Jain --- cmds-filesystem.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 9e0c8b9..74b7a06 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -273,10 +273,21 @@ static int print_one_fs(struct btrfs_ioctl_fs_info_args *fs_info, int i; char uuidbuf[37]; struct btrfs_ioctl_dev_info_args *tmp_dev_info; + u64 flags; uuid_unparse(fs_info->fsid, uuidbuf); - printf("Label: %s uuid: %s\n", - strlen(label) ? label : "none", uuidbuf); + printf("Label: %s uuid: %s mounted: %s\n", + strlen(label) ? label : "none", uuidbuf, path); + printf("\tGroup profile:"); + for (i = space_info->total_spaces - 1; i >= 0; i--) { + flags = space_info->spaces[i].flags; + if (flags & BTRFS_BLOCK_GROUP_SYSTEM) + continue; + printf(" %s: %s", group_type_str(flags), + group_profile_str(flags)); + printf(" "); + } + printf("\n"); printf("\tTotal devices %llu FS bytes used %s\n", fs_info->num_devices,