pmem.h 847 B

12345678910111213141516171819202122232425262728
  1. #ifndef __NVDIMM_PMEM_H__
  2. #define __NVDIMM_PMEM_H__
  3. #include <linux/badblocks.h>
  4. #include <linux/types.h>
  5. #include <linux/pfn_t.h>
  6. #include <linux/fs.h>
  7. /* this definition is in it's own header for tools/testing/nvdimm to consume */
  8. struct pmem_device {
  9. /* One contiguous memory region per device */
  10. phys_addr_t phys_addr;
  11. /* when non-zero this device is hosting a 'pfn' instance */
  12. phys_addr_t data_offset;
  13. u64 pfn_flags;
  14. void *virt_addr;
  15. /* immutable base size of the namespace */
  16. size_t size;
  17. /* trim size when namespace capacity has been section aligned */
  18. u32 pfn_pad;
  19. struct kernfs_node *bb_state;
  20. struct badblocks bb;
  21. struct dax_device *dax_dev;
  22. struct gendisk *disk;
  23. };
  24. long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff,
  25. long nr_pages, void **kaddr, pfn_t *pfn);
  26. #endif /* __NVDIMM_PMEM_H__ */