Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5860039ybi; Wed, 31 Jul 2019 04:31:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0vuzqKr8ed6z4kNEIWX5vRwmnApwzQ1kSbKHxhX4hpjHOqxrlILNMdrlKkKJr3CxXkmKv X-Received: by 2002:a17:902:296a:: with SMTP id g97mr117624349plb.115.1564572701103; Wed, 31 Jul 2019 04:31:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564572701; cv=none; d=google.com; s=arc-20160816; b=Zpo5pZ/tKI4zt8jjlMan2UY/5/+YF13c1o9oTCfYhlOKzES2vh2nqB3Twtf64cqcuZ 3Q5S7OSDjU1b2qp70TEyQUBuO7RiymT8/RPiw96Q6m+fGBZ6xXdL67Z0vciPq8MYRGZs I/vg7ai4rhOldQ6CJusnW7+BlixVGpnZuRTsXa2+fNAGKHUbQrPuuqUBmoKFTpdieONY DoduUg2ZQbcVPW74k/ArCx9jVL819lNQtyt8e1zsa2yQnrpLuktjUpZ7ofgwRWuKGBnd mcyK/icf7mQQscfq8Mhnyl9SK/aTnEIoCZ6PtPWpWym57I/iEnSwchiX09fijS9iw17m oLvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=G3CTHVM1Lv6LwiYumeNf+m0Sk3yYRegoQje3fTeV9YM=; b=rnytzhFi1odOz2LUWTl5Wa8nznp0+W+QqvaDbrgTYsFPQTrDmzEiEsXNiJut/y0HMU IY4rVC+/HsrTR7LG8xE+UPHL/6AYw2xE0fjOAW2qYMeiwzqwNieYWn3tz50BwrXttPrn ImeECfv8A+knr60eWqmkKcqcoMXtG0YFxSFwoHp7pmCCLVFeKbz0FDZCnz03iPUCMozG OCCmVQBNkLikJijgPdqlBtO2sCr4uxZSJndthL1IHVjxVpZXTelM7AXEDQmpT6Nypdrx 88F15MgguiLDaqvFZGvKSeHa95TEqJWwTvhlm08fIsxZdMm7Qh2NmyFmlSYejRyhGCe9 yGpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e80si30888781pfh.121.2019.07.31.04.31.25; Wed, 31 Jul 2019 04:31:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728492AbfGaLML (ORCPT + 99 others); Wed, 31 Jul 2019 07:12:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45366 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727856AbfGaLML (ORCPT ); Wed, 31 Jul 2019 07:12:11 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 698D73B71F; Wed, 31 Jul 2019 11:12:11 +0000 (UTC) Received: from dhcp201-121.englab.pnq.redhat.com (unknown [10.65.16.75]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1EAC600D1; Wed, 31 Jul 2019 11:12:08 +0000 (UTC) From: Pankaj Gupta To: dan.j.williams@intel.com Cc: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, vishal.l.verma@intel.com, dave.jiang@intel.com, keith.busch@intel.com, ira.weiny@intel.com, pagupta@redhat.com Subject: [PATCH] libnvdimm: change disk name of virtio pmem disk Date: Wed, 31 Jul 2019 16:42:07 +0530 Message-Id: <20190731111207.12836-1-pagupta@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 31 Jul 2019 11:12:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds prefix 'v' in disk name for virtio pmem. This differentiates virtio-pmem disks from the pmem disks. Signed-off-by: Pankaj Gupta --- drivers/nvdimm/namespace_devs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c index a16e52251a30..8e5d29266fb0 100644 --- a/drivers/nvdimm/namespace_devs.c +++ b/drivers/nvdimm/namespace_devs.c @@ -182,8 +182,12 @@ const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns, char *name) { struct nd_region *nd_region = to_nd_region(ndns->dev.parent); + const char *prefix = ""; const char *suffix = NULL; + if (!is_nvdimm_sync(nd_region)) + prefix = "v"; + if (ndns->claim && is_nd_btt(ndns->claim)) suffix = "s"; @@ -201,7 +205,7 @@ const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns, sprintf(name, "pmem%d.%d%s", nd_region->id, nsidx, suffix ? suffix : ""); else - sprintf(name, "pmem%d%s", nd_region->id, + sprintf(name, "%spmem%d%s", prefix, nd_region->id, suffix ? suffix : ""); } else if (is_namespace_blk(&ndns->dev)) { struct nd_namespace_blk *nsblk; -- 2.20.1