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