@@ -1612,6 +1612,8 @@ static json_object *pfn_parse(struct pfn_sb *pfn_sb, struct ndctl_namespace *ndn
parse_hex(pfn_sb, start_pad, 32);
parse_hex(pfn_sb, end_trunc, 32);
parse_hex(pfn_sb, align, 32);
+ parse_hex(pfn_sb, page_size, 32);
+ parse_hex(pfn_sb, page_struct_size, 16);
return jblock;
err:
@@ -209,6 +209,12 @@ struct arena_map {
#define PFN_SIG "NVDIMM_PFN_INFO\0"
#define DAX_SIG "NVDIMM_DAX_INFO\0"
+enum pfn_mode {
+ PFN_MODE_NONE,
+ PFN_MODE_RAM,
+ PFN_MODE_PMEM,
+};
+
struct pfn_sb {
u8 signature[PFN_SIG_LEN];
u8 uuid[16];
@@ -224,7 +230,11 @@ struct pfn_sb {
le32 end_trunc;
/* minor-version-2 record the base alignment of the mapping */
le32 align;
- u8 padding[4000];
+ /* minor-version-3 guarantee the padding and flags are zero */
+ /* minor-version-4 record the page size and struct page size */
+ le32 page_size;
+ le16 page_struct_size;
+ u8 padding[3994];
le64 checksum;
};
Grab the latest definition of the pfn infoblock in preparation for creating a write-infoblock command, and update read-infoblock parsing. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- ndctl/namespace.c | 2 ++ ndctl/namespace.h | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-)