pmem.h 886 B

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