pmem.h 765 B

12345678910111213141516171819202122232425
  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. long pmem_direct_access(struct block_device *bdev, sector_t sector,
  8. void **kaddr, pfn_t *pfn, long size);
  9. /* this definition is in it's own header for tools/testing/nvdimm to consume */
  10. struct pmem_device {
  11. /* One contiguous memory region per device */
  12. phys_addr_t phys_addr;
  13. /* when non-zero this device is hosting a 'pfn' instance */
  14. phys_addr_t data_offset;
  15. u64 pfn_flags;
  16. void *virt_addr;
  17. /* immutable base size of the namespace */
  18. size_t size;
  19. /* trim size when namespace capacity has been section aligned */
  20. u32 pfn_pad;
  21. struct badblocks bb;
  22. };
  23. #endif /* __NVDIMM_PMEM_H__ */