Thread (78 messages) flat view 78 messages, 7 authors, 2021-08-25

Re: [PATCH v3 11/14] device-dax: ensure dev_dax->pgmap is valid for dynamic devices

From: Dan Williams <hidden>
Date: 2021-07-28 07:30:48
Also in: linux-mm, nvdimm

On Wed, Jul 14, 2021 at 12:36 PM Joao Martins [off-list ref] wrote:
Right now, only static dax regions have a valid @pgmap pointer in its
struct dev_dax. Dynamic dax case however, do not.

In preparation for device-dax compound pagemap support, make sure that
dev_dax pgmap field is set after it has been allocated and initialized.
I think this is ok to fold into the patch that needs it.
quoted hunk ↗ jump to hunk
Suggested-by: Dan Williams <redacted>
Signed-off-by: Joao Martins <redacted>
---
 drivers/dax/device.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index 0b82159b3564..6e348b5f9d45 100644
--- a/drivers/dax/device.c
+++ b/drivers/dax/device.c
@@ -426,6 +426,8 @@ int dev_dax_probe(struct dev_dax *dev_dax)
        }

        pgmap->type = MEMORY_DEVICE_GENERIC;
+       dev_dax->pgmap = pgmap;
+
        addr = devm_memremap_pages(dev, pgmap);
        if (IS_ERR(addr))
                return PTR_ERR(addr);
--
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help