From patchwork Mon Nov 9 10:58:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 7582561 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 76CB6C05C6 for ; Mon, 9 Nov 2015 10:59:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF85B2069D for ; Mon, 9 Nov 2015 10:59:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D6AF620697 for ; Mon, 9 Nov 2015 10:59:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752859AbbKIK7v (ORCPT ); Mon, 9 Nov 2015 05:59:51 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:51913 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751294AbbKIK7s (ORCPT ); Mon, 9 Nov 2015 05:59:48 -0500 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 tA9AxlQD016242 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Nov 2015 10:59:47 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id tA9AxlCL013955 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 9 Nov 2015 10:59:47 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id tA9AxlE9004271 for ; Mon, 9 Nov 2015 10:59:47 GMT Received: from arch2.sg.oracle.com (/10.186.101.93) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 09 Nov 2015 02:59:46 -0800 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 3/4] btrfs-progs: add fi show for spare Date: Mon, 9 Nov 2015 18:58:38 +0800 Message-Id: <1447066719-3880-4-git-send-email-anand.jain@oracle.com> X-Mailer: git-send-email 2.4.1 In-Reply-To: <1447066719-3880-1-git-send-email-anand.jain@oracle.com> References: <1447066589-3835-1-git-send-email-anand.jain@oracle.com> <1447066719-3880-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.2 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 4d3a9a4..11d0406 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -353,6 +353,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); @@ -610,6 +613,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));