summaryrefslogtreecommitdiff
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2018-04-09 10:50:17 -0700
committerDan Williams <dan.j.williams@intel.com>2018-04-09 10:50:17 -0700
commite13e75b86ef2f88e3a47d672dd4c52a293efb95b (patch)
tree2617aebd952d1aec09d323f6b2484b93f659e753 /drivers/md/dm.c
parent1ed41b5696ccc3ff40a1dee39fe14eff273faf82 (diff)
parent976431b02c2ef92ae3f8b6a7d699fc554025e118 (diff)
Merge branch 'for-4.17/dax' into libnvdimm-for-next
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 45328d8b2859..bac79f40f3cb 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1805,7 +1805,7 @@ static void cleanup_mapped_device(struct mapped_device *md)
static struct mapped_device *alloc_dev(int minor)
{
int r, numa_node_id = dm_get_numa_node();
- struct dax_device *dax_dev;
+ struct dax_device *dax_dev = NULL;
struct mapped_device *md;
void *old_md;
@@ -1871,9 +1871,11 @@ static struct mapped_device *alloc_dev(int minor)
md->disk->private_data = md;
sprintf(md->disk->disk_name, "dm-%d", minor);
- dax_dev = alloc_dax(md, md->disk->disk_name, &dm_dax_ops);
- if (!dax_dev)
- goto bad;
+ if (IS_ENABLED(CONFIG_DAX_DRIVER)) {
+ dax_dev = alloc_dax(md, md->disk->disk_name, &dm_dax_ops);
+ if (!dax_dev)
+ goto bad;
+ }
md->dax_dev = dax_dev;
add_disk_no_queue_reg(md->disk);