From patchwork Tue Mar 29 14:27:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 8687731 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3CD6E9F36E for ; Tue, 29 Mar 2016 14:27:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7505820125 for ; Tue, 29 Mar 2016 14:27:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C7C620166 for ; Tue, 29 Mar 2016 14:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756298AbcC2O1o (ORCPT ); Tue, 29 Mar 2016 10:27:44 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:50956 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751577AbcC2O1n (ORCPT ); Tue, 29 Mar 2016 10:27:43 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u2TERXNt019127 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Mar 2016 14:27:34 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u2TERXiI002742 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Mar 2016 14:27:33 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u2TERXeB004969; Tue, 29 Mar 2016 14:27:33 GMT Received: from arch2.sg.oracle.com (/10.186.101.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 29 Mar 2016 07:27:32 -0700 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: clm@fb.com, dsterba@suse.cz Subject: [PATCH 3/4] btrfs-progs: add fi show for spare Date: Tue, 29 Mar 2016 22:27:20 +0800 Message-Id: <1459261641-32254-3-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1459261641-32254-1-git-send-email-anand.jain@oracle.com> References: <1459261349-32206-1-git-send-email-anand.jain@oracle.com> <1459261641-32254-1-git-send-email-anand.jain@oracle.com> X-Source-IP: userv0022.oracle.com [156.151.31.74] 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.9 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 Signed-off-by: Anand Jain --- cmds-filesystem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 38404d29026e..0901c47e8679 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -351,6 +351,9 @@ static void print_one_uuid(struct btrfs_fs_devices *fs_devices, if (add_seen_fsid(fs_devices->fsid)) return; + if (fs_devices->spare) + return; + uuid_unparse(fs_devices->fsid, uuidbuf); device = list_entry(fs_devices->devices.next, struct btrfs_device, dev_list); @@ -597,6 +600,7 @@ static int copy_fs_devices(struct btrfs_fs_devices *dst, memcpy(dst->fsid, src->fsid, BTRFS_FSID_SIZE); INIT_LIST_HEAD(&dst->devices); dst->seed = NULL; + dst->spare = src->spare; list_for_each_entry(cur_dev, &src->devices, dev_list) { dev_copy = malloc(sizeof(*dev_copy));