提交 01220733 编写于 作者: D Dan Williams

libnvdimm, namespace: expand pmem device naming scheme for multi-pmem

pmem devices are currently named /dev/pmem<region-index>. Preserve the
naming of the 0th device, but add a ".<namespace-index>" for other
devices.
Signed-off-by: NDan Williams <dan.j.williams@intel.com>
上级 a1f3e4d6
...@@ -173,7 +173,21 @@ const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns, ...@@ -173,7 +173,21 @@ const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns,
suffix = "s"; suffix = "s";
if (is_namespace_pmem(&ndns->dev) || is_namespace_io(&ndns->dev)) { if (is_namespace_pmem(&ndns->dev) || is_namespace_io(&ndns->dev)) {
sprintf(name, "pmem%d%s", nd_region->id, suffix ? suffix : ""); int nsidx = 0;
if (is_namespace_pmem(&ndns->dev)) {
struct nd_namespace_pmem *nspm;
nspm = to_nd_namespace_pmem(&ndns->dev);
nsidx = nspm->id;
}
if (nsidx)
sprintf(name, "pmem%d.%d%s", nd_region->id, nsidx,
suffix ? suffix : "");
else
sprintf(name, "pmem%d%s", nd_region->id,
suffix ? suffix : "");
} else if (is_namespace_blk(&ndns->dev)) { } else if (is_namespace_blk(&ndns->dev)) {
struct nd_namespace_blk *nsblk; struct nd_namespace_blk *nsblk;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册