summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2026-10-19 14:56:11 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2026-10-19 14:56:11 +0200
commitc87dd99b6d0fe07e836c1593c03e8174029c66f4 (patch)
tree66b2be6ecc1cb9f8e72b7e53d796d988be0351d5 /include/linux
parentbf4ccbaad8bdff8c90fd290ed6135b63f89ee8a7 (diff)
downloadlinux-next-c87dd99b6d0fe07e836c1593c03e8174029c66f4.tar.gz
linux-next-c87dd99b6d0fe07e836c1593c03e8174029c66f4.zip
dax: add fsdev_dax_from_file()
If the file is a fsdev_dax open, take the dax_dev from the device inode's i_cdev. Return with a reference grabbed on the private dax inode. Make dax_dev_get() static again (internal to super.c for alloc_dax), export fsdev_dax_from_file() instead. This fix is in response to a Sashiko review, and some subsequent analysis. About the 'fixes' tag: this removes the export of dax_dev_get(), which was flawed, and replaces it with fsdev_dax_from_file(). It feels like the fixes tag makes sense for correcting an ABI error. Fixes: 2ae624d5a555d ("dax: export dax_dev_get()") Originally-by: John Groves <john@groves.net> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Gregory Price (Meta) <gourry@gourry.net> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dax.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h
index fe6c3ded1b50..2c9fc81f031b 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -54,7 +54,6 @@ struct dax_device *alloc_dax(void *private, const struct dax_operations *ops);
void *dax_holder(struct dax_device *dax_dev);
void put_dax(struct dax_device *dax_dev);
void kill_dax(struct dax_device *dax_dev);
-struct dax_device *dax_dev_get(dev_t devt);
void dax_write_cache(struct dax_device *dax_dev, bool wc);
bool dax_write_cache_enabled(struct dax_device *dax_dev);
bool dax_synchronous(struct dax_device *dax_dev);
@@ -323,3 +322,5 @@ typedef int (*walk_hmem_fn)(struct device *dev, int target_nid,
const struct resource *res);
int walk_hmem_resources(struct device *dev, walk_hmem_fn fn);
#endif
+
+struct dax_device *fsdev_dax_from_file(struct file *file);