summaryrefslogtreecommitdiff
path: root/drivers/nvdimm/pmem.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2017-01-25 10:02:09 +0300
committerDan Williams <dan.j.williams@intel.com>2017-04-20 01:14:35 +0300
commitc1d6e828a35df524df2af277eedd1471d05e4f4c (patch)
treee0e22fcca09c7b5bb9d1c74d9e0b48da11bae8a7 /drivers/nvdimm/pmem.h
parent6568b08b77816cda2a95919c7494108d983d5941 (diff)
downloadlinux-c1d6e828a35df524df2af277eedd1471d05e4f4c.tar.xz
pmem: add dax_operations support
Setup a dax_device to have the same lifetime as the pmem block device and add a ->direct_access() method that is equivalent to pmem_direct_access(). Once fs/dax.c has been converted to use dax_operations the old pmem_direct_access() will be removed. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/pmem.h')
-rw-r--r--drivers/nvdimm/pmem.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/nvdimm/pmem.h b/drivers/nvdimm/pmem.h
index b4ee4f71b4a1..7f4dbd72a90a 100644
--- a/drivers/nvdimm/pmem.h
+++ b/drivers/nvdimm/pmem.h
@@ -5,8 +5,6 @@
#include <linux/pfn_t.h>
#include <linux/fs.h>
-long pmem_direct_access(struct block_device *bdev, sector_t sector,
- void **kaddr, pfn_t *pfn, long size);
/* this definition is in it's own header for tools/testing/nvdimm to consume */
struct pmem_device {
/* One contiguous memory region per device */
@@ -20,5 +18,10 @@ struct pmem_device {
/* trim size when namespace capacity has been section aligned */
u32 pfn_pad;
struct badblocks bb;
+ struct dax_device *dax_dev;
+ struct gendisk *disk;
};
+
+long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff,
+ long nr_pages, void **kaddr, pfn_t *pfn);
#endif /* __NVDIMM_PMEM_H__ */