linux/drivers/dax
John Groves 099c81a1f0 dax: Add dax_operations for use by fs-dax on fsdev dax
fsdev: Add dax_operations for use by famfs.

This replicates the functionality from drivers/nvdimm/pmem.c that
conventional fs-dax file systems (e.g. xfs) use to support dax
read/write/mmap to a daxdev - without which famfs can't sit atop a
daxdev.

- These methods are based on pmem_dax_ops from drivers/nvdimm/pmem.c
- fsdev_dax_direct_access() returns the hpa, pfn and kva. The kva was
  newly stored as dev_dax->virt_addr by dev_dax_probe().
- The hpa/pfn are used for mmap (dax_iomap_fault()), and the kva is used
  for read/write (dax_iomap_rw())
- fsdev_dax_recovery_write() and dev_dax_zero_page_range() have not been
  tested yet. I'm looking for suggestions as to how to test those.
- dax-private.h: add dev_dax->cached_size, which fsdev needs to
  remember. The dev_dax size cannot change while a driver is bound
  (dev_dax_resize returns -EBUSY if dev->driver is set). Caching the size
  at probe time allows fsdev's direct_access path can use it without
  acquiring dax_dev_rwsem (which isn't exported anyway).

Signed-off-by: John Groves <john@groves.net>
Link: https://patch.msgid.link/0100019d311d415a-bd6af0fe-5445-484c-9d39-210b8170b686-000000@email.amazonses.com
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
2026-03-30 08:20:48 -05:00
..
hmem dax/hmem, e820, resource: Defer Soft Reserved insertion until hmem is ready 2026-01-16 09:02:36 -07:00
bus.c dax: move dax_pgoff_to_phys from [drivers/dax/] device.c to bus.c 2026-03-30 08:20:47 -05:00
bus.h dax: add fsdev.c driver for fs-dax on character dax 2026-03-30 08:20:47 -05:00
cxl.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
dax-private.h dax: Add dax_operations for use by fs-dax on fsdev dax 2026-03-30 08:20:48 -05:00
device.c dax: move dax_pgoff_to_phys from [drivers/dax/] device.c to bus.c 2026-03-30 08:20:47 -05:00
fsdev.c dax: Add dax_operations for use by fs-dax on fsdev dax 2026-03-30 08:20:48 -05:00
Kconfig dax: add fsdev.c driver for fs-dax on character dax 2026-03-30 08:20:47 -05:00
kmem.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Makefile dax: add fsdev.c driver for fs-dax on character dax 2026-03-30 08:20:47 -05:00
pmem.c mm: remove callers of pfn_t functionality 2025-07-09 22:42:19 -07:00
super.c Coccinelle-based conversion to use ->i_state accessors 2025-10-20 20:22:26 +02:00