Thread (45 messages) 45 messages, 10 authors, 2021-11-05

Re: [PATCH 03/11] dax: simplify the dax_device <-> gendisk association

From: Mike Snitzer <hidden>
Date: 2021-11-01 16:28:47
Also in: dm-devel, linux-ext4, linux-fsdevel, linux-s390, nvdimm, virtualization

On Mon, Oct 18 2021 at 12:40P -0400,
Christoph Hellwig [off-list ref] wrote:
Replace the dax_host_hash with an xarray indexed by the pointer value
of the gendisk, and require explicitl calls from the block drivers that
want to associate their gendisk with a dax_device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
...
quoted hunk ↗ jump to hunk
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 79737aee516b1..a0a4703620650 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1683,6 +1683,7 @@ static void cleanup_mapped_device(struct mapped_device *md)
 	bioset_exit(&md->io_bs);
 
 	if (md->dax_dev) {
+		dax_remove_host(md->disk);
 		kill_dax(md->dax_dev);
 		put_dax(md->dax_dev);
 		md->dax_dev = NULL;
@@ -1784,10 +1785,11 @@ static struct mapped_device *alloc_dev(int minor)
 	sprintf(md->disk->disk_name, "dm-%d", minor);
 
 	if (IS_ENABLED(CONFIG_FS_DAX)) {
-		md->dax_dev = alloc_dax(md, md->disk->disk_name,
-					&dm_dax_ops, 0);
+		md->dax_dev = alloc_dax(md, &dm_dax_ops, 0);
 		if (IS_ERR(md->dax_dev))
 			goto bad;
+		if (dax_add_host(md->dax_dev, md->disk))
+			goto bad;
 	}
 
 	format_dev_t(md->name, MKDEV(_major, minor));
Acked-by: Mike Snitzer <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help