]> git.ipfire.org Git - thirdparty/linux.git/commit
dax: add fsdev.c driver for fs-dax on character dax
authorJohn Groves <john@groves.net>
Fri, 27 Mar 2026 21:04:35 +0000 (21:04 +0000)
committerIra Weiny <ira.weiny@intel.com>
Mon, 30 Mar 2026 13:20:47 +0000 (08:20 -0500)
commitd5406bd458b0ac10b1301a4d5801d85c8f648637
tree4e51f8a6c6c39c716a4a52b498c2ce7d331c3893
parent59eb73b98ae0b12fc9b39c08f0f5a5552cb02d1e
dax: add fsdev.c driver for fs-dax on character dax

The new fsdev driver provides pages/folios initialized compatibly with
fsdax - normal rather than devdax-style refcounting, and starting out
with order-0 folios.

When fsdev binds to a daxdev, it is usually (always?) switching from the
devdax mode (device.c), which pre-initializes compound folios according
to its alignment. Fsdev uses fsdev_clear_folio_state() to switch the
folios into a fsdax-compatible state.

A side effect of this is that raw mmap doesn't (can't?) work on an fsdev
dax instance. Accordingly, The fsdev driver does not provide raw mmap -
devices must be put in 'devdax' mode (drivers/dax/device.c) to get raw
mmap capability.

In this commit is just the framework, which remaps pages/folios compatibly
with fsdax.

Enabling dax changes:

- bus.h: add DAXDRV_FSDEV_TYPE driver type
- bus.c: allow DAXDRV_FSDEV_TYPE drivers to bind to daxdevs
- dax.h: prototype inode_dax(), which fsdev needs

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Suggested-by: Gregory Price <gourry@gourry.net>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: John Groves <john@groves.net>
Link: https://patch.msgid.link/0100019d311cf904-419e9526-bdaf-4daa-97f1-5060b31a5c9f-000000@email.amazonses.com
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
MAINTAINERS
drivers/dax/Kconfig
drivers/dax/Makefile
drivers/dax/bus.h
drivers/dax/fsdev.c [new file with mode: 0644]
fs/dax.c