From patchwork Wed Dec 17 20:14:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goffredo Baroncelli X-Patchwork-Id: 5509121 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 70CB8BEEA8 for ; Wed, 17 Dec 2014 20:13:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AFADE209E1 for ; Wed, 17 Dec 2014 20:13:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DACEA209DE for ; Wed, 17 Dec 2014 20:13:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751274AbaLQUNE (ORCPT ); Wed, 17 Dec 2014 15:13:04 -0500 Received: from mail-wi0-f177.google.com ([209.85.212.177]:50130 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbaLQUM7 (ORCPT ); Wed, 17 Dec 2014 15:12:59 -0500 Received: by mail-wi0-f177.google.com with SMTP id l15so58982wiw.4 for ; Wed, 17 Dec 2014 12:12:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aTwA3vDy7/Hix5ywH4H46JNAqgdh3Rdd/wIjG69rP3o=; b=Xu+kfm6THCR71K+DcvtD8obB1wJweTOjgBV2u7UK0Gi1NDPADQ14tR7lS5AztTkqfK 1ZiN7d/OIeSS5r8C/qdtaW3O3MhCqXZVrZoh/ODfh78bbJD9JdGZO2iqV2tqDt7GbtL5 hvdJ+QeJXrRbSWlomoT75TexxbZfv3hwoxSWgQgfBQNwrq/1k4WjVohRdb53O7FbzjxL JM8U3YQ4ZTsVTdxrgTohKCGfXy7/KIBzuf73B/rWGlNzN7PJ+QI/2G2ojTgXuR5rotwR m7K+ZJ3r5NpVn+BmlMyy+2V15XmYVkg5hlFyECyIKSAHrC6Cf8JRyY6qUTfTpdlBkwY1 QEvQ== X-Received: by 10.180.208.69 with SMTP id mc5mr18113811wic.25.1418847178914; Wed, 17 Dec 2014 12:12:58 -0800 (PST) Received: from venice.bhome (ppp-133-85.24-151.libero.it. [151.24.85.133]) by mx.google.com with ESMTPSA id pu3sm6360357wjc.14.2014.12.17.12.12.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Dec 2014 12:12:58 -0800 (PST) From: Goffredo Baroncelli X-Google-Original-From: Goffredo Baroncelli To: linux-btrfs@vger.kernel.org Cc: Goffredo Baroncelli Subject: [PATCH 4/8] Add strdup in btrfs_add_to_fsid() to track the device path. Date: Wed, 17 Dec 2014 21:14:08 +0100 Message-Id: <1418847252-14184-5-git-send-email-kreijack@inwind.it> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1418847252-14184-1-git-send-email-kreijack@inwind.it> References: <1418847252-14184-1-git-send-email-kreijack@inwind.it> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 When creating a new btrfs_device, copy the path to track it. This path is then used by mkfs.btrfs to list all devices. Signed-off-by: Goffredo Baroncelli Reviewed-by: Satoru Takeuchi --- utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/utils.c b/utils.c index dcb4f74..3f50e4d 100644 --- a/utils.c +++ b/utils.c @@ -647,6 +647,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans, device->bytes_used = 0; device->total_ios = 0; device->dev_root = root->fs_info->dev_root; + device->name = strdup(path); ret = btrfs_add_device(trans, root, device); BUG_ON(ret);