pfn.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2014-2015, Intel Corporation.
  4. */
  5. #ifndef __NVDIMM_PFN_H
  6. #define __NVDIMM_PFN_H
  7. #include <linux/types.h>
  8. #include <linux/mmzone.h>
  9. #define PFN_SIG_LEN 16
  10. #define PFN_SIG "NVDIMM_PFN_INFO\0"
  11. #define DAX_SIG "NVDIMM_DAX_INFO\0"
  12. struct nd_pfn_sb {
  13. u8 signature[PFN_SIG_LEN];
  14. u8 uuid[16];
  15. u8 parent_uuid[16];
  16. __le32 flags;
  17. __le16 version_major;
  18. __le16 version_minor;
  19. __le64 dataoff; /* relative to namespace_base + start_pad */
  20. __le64 npfns;
  21. __le32 mode;
  22. /* minor-version-1 additions for section alignment */
  23. /**
  24. * @start_pad: Deprecated attribute to pad start-misaligned namespaces
  25. *
  26. * start_pad is deprecated because the original definition did
  27. * not comprehend that dataoff is relative to the base address
  28. * of the namespace not the start_pad adjusted base. The result
  29. * is that the dax path is broken, but the block-I/O path is
  30. * not. The kernel will no longer create namespaces using start
  31. * padding, but it still supports block-I/O for legacy
  32. * configurations mainly to allow a backup, reconfigure the
  33. * namespace, and restore flow to repair dax operation.
  34. */
  35. __le32 start_pad;
  36. __le32 end_trunc;
  37. /* minor-version-2 record the base alignment of the mapping */
  38. __le32 align;
  39. /* minor-version-3 guarantee the padding and flags are zero */
  40. /* minor-version-4 record the page size and struct page size */
  41. __le32 page_size;
  42. __le16 page_struct_size;
  43. u8 padding[3994];
  44. __le64 checksum;
  45. };
  46. #endif /* __NVDIMM_PFN_H */