diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-01-25 03:44:18 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-04-20 00:14:35 +0200 |
commit | 6568b08b77816cda2a95919c7494108d983d5941 (patch) | |
tree | cdc776afdf8dd6c583155d169017eb78ab94a8bf /include | |
parent | dax: add a facility to lookup a dax device by 'host' device name (diff) | |
download | linux-6568b08b77816cda2a95919c7494108d983d5941.tar.xz linux-6568b08b77816cda2a95919c7494108d983d5941.zip |
dax: introduce dax_operations
Track a set of dax_operations per dax_device that can be set at
alloc_dax() time. These operations will be used to stop the abuse of
block_device_operations for communicating dax capabilities to
filesystems. It will also be used to replace the "pmem api" and move
pmem-specific cache maintenance, and other dax-driver-specific
filesystem-dax operations, to dax device methods. In particular this
allows us to stop abusing __copy_user_nocache(), via memcpy_to_pmem(),
with a driver specific replacement.
This is a standalone introduction of the operations. Follow on patches
convert each dax-driver and teach fs/dax.c to use ->direct_access() from
dax_operations instead of block_device_operations.
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dax.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h index 9b2d5ba10d7d..74ebb92b625a 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -7,6 +7,16 @@ #include <asm/pgtable.h> struct iomap_ops; +struct dax_device; +struct dax_operations { + /* + * direct_access: translate a device-relative + * logical-page-offset into an absolute physical pfn. Return the + * number of pages available for DAX at that pfn. + */ + long (*direct_access)(struct dax_device *, pgoff_t, long, + void **, pfn_t *); +}; int dax_read_lock(void); void dax_read_unlock(int id); |