]> git.ipfire.org Git - thirdparty/linux.git/commit
dax: Add dax_set_ops() for setting dax_operations at bind time
authorJohn Groves <John@Groves.net>
Fri, 27 Mar 2026 21:05:03 +0000 (21:05 +0000)
committerIra Weiny <ira.weiny@intel.com>
Mon, 30 Mar 2026 13:20:48 +0000 (08:20 -0500)
commit700ecbc1f5aa02ba9ad68d7be1ef7a9c8eae07e9
treebe7b743bf0eebf89e239af1c97dc39ea01722b78
parent099c81a1f0ab3e948d73c5ab2b7a3b702af36e64
dax: Add dax_set_ops() for setting dax_operations at bind time

Add a new dax_set_ops() function that allows drivers to set the
dax_operations after the dax_device has been allocated. This is needed
for fsdev_dax where the operations need to be set during probe and
cleared during unbind.

The fsdev driver uses devm_add_action_or_reset() for cleanup consistency,
avoiding the complexity of mixing devm-managed resources with manual
cleanup in a remove() callback. This ensures cleanup happens automatically
in the correct reverse order when the device is unbound.

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: John Groves <john@groves.net>
Link: https://patch.msgid.link/0100019d311d65a0-b9c1419e-f3a0-4afd-b0bd-848f18ff5950-000000@email.amazonses.com
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
drivers/dax/fsdev.c
drivers/dax/super.c
include/linux/dax.h