From patchwork Mon Dec 15 20:02:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goffredo Baroncelli X-Patchwork-Id: 5497451 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 B83369F1D4 for ; Mon, 15 Dec 2014 20:02:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED654209E5 for ; Mon, 15 Dec 2014 20:02:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2717209D3 for ; Mon, 15 Dec 2014 20:02:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751354AbaLOUCl (ORCPT ); Mon, 15 Dec 2014 15:02:41 -0500 Received: from mail-wi0-f170.google.com ([209.85.212.170]:61107 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbaLOUCl (ORCPT ); Mon, 15 Dec 2014 15:02:41 -0500 Received: by mail-wi0-f170.google.com with SMTP id bs8so11633548wib.3 for ; Mon, 15 Dec 2014 12:02:40 -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=kP7yTOCOka8a1uM6qckD6aQUPyZpjtyZIyegBwmuLbCBKp3fJQXEsa4HeQi9vrjify lutsbRHWSZpC32/nhBGu2z6GrpzEls5GcJbWkALiU0G1sa0neMU9E5AkbhptdQcYJNt4 1CkRtNJVbRh6kprTaDGHpwwag/0gydi/e2eo2JUYO+TuhHdDat7mmW5sEvsBgrIiQryM 7zpzlQfa+A/EdME38wsu+UziQQ6f/tMw5YtSv8DELqTHt6d/5+VNlc0ij3lmc7C0m3fS cLMN9Je/pwFp9RJN6kDnzh9cEeBNmy/atXaZM9cEgxgjPA69NEVV5saz9uV/44QIQk9P NtZw== X-Received: by 10.194.188.13 with SMTP id fw13mr33039853wjc.83.1418673759950; Mon, 15 Dec 2014 12:02:39 -0800 (PST) Received: from venice.bhome (ppp-222-126.24-151.libero.it. [151.24.126.222]) by mx.google.com with ESMTPSA id kn5sm14212241wjb.48.2014.12.15.12.02.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Dec 2014 12:02:39 -0800 (PST) From: Goffredo Baroncelli X-Google-Original-From: Goffredo Baroncelli To: linux-btrfs@vger.kernel.org Cc: Goffredo Baroncelli Subject: [PATCH 4/7] Add strdup in btrfs_add_to_fsid() to track the device path. Date: Mon, 15 Dec 2014 21:02:57 +0100 Message-Id: <1418673780-22000-5-git-send-email-kreijack@inwind.it> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1418673780-22000-1-git-send-email-kreijack@inwind.it> References: <1418673780-22000-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 --- 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);