]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dax: Add fs_dax_get() func to prepare dax for fs-dax usage
authorJohn Groves <john@groves.net>
Fri, 27 Mar 2026 21:05:12 +0000 (21:05 +0000)
committerIra Weiny <ira.weiny@intel.com>
Mon, 30 Mar 2026 13:20:48 +0000 (08:20 -0500)
commiteec38f5d86d27535509c99f02ccc642ceb0c3e2a
treecd91e965d44ca6817c625f4c191d5962fbcee09a
parent700ecbc1f5aa02ba9ad68d7be1ef7a9c8eae07e9
dax: Add fs_dax_get() func to prepare dax for fs-dax usage

The fs_dax_get() function should be called by fs-dax file systems after
opening a fsdev dax device. This adds holder_operations, which provides
a memory failure callback path and effects exclusivity between callers
of fs_dax_get().

fs_dax_get() is specific to fsdev_dax, so it checks the driver type
(which required touching bus.[ch]). fs_dax_get() fails if fsdev_dax is
not bound to the memory.

This function serves the same role as fs_dax_get_by_bdev(), which dax
file systems call after opening the pmem block device.

This can't be located in fsdev.c because struct dax_device is opaque
there.

This will be called by fs/fuse/famfs.c in a subsequent commit.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: John Groves <john@groves.net>
Link: https://patch.msgid.link/0100019d311d8750-75395c22-031b-4d5f-aebe-790dca656b87-000000@email.amazonses.com
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
drivers/dax/bus.c
drivers/dax/bus.h
drivers/dax/super.c
include/linux/dax.h