2019-05-29 17:18:02 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2015-07-31 00:57:47 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014-2015, Intel Corporation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __NVDIMM_PFN_H
|
|
|
|
#define __NVDIMM_PFN_H
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
2016-03-03 20:14:36 +03:00
|
|
|
#include <linux/mmzone.h>
|
2015-07-31 00:57:47 +03:00
|
|
|
|
|
|
|
#define PFN_SIG_LEN 16
|
|
|
|
#define PFN_SIG "NVDIMM_PFN_INFO\0"
|
2016-05-19 00:50:12 +03:00
|
|
|
#define DAX_SIG "NVDIMM_DAX_INFO\0"
|
2015-07-31 00:57:47 +03:00
|
|
|
|
|
|
|
struct nd_pfn_sb {
|
|
|
|
u8 signature[PFN_SIG_LEN];
|
|
|
|
u8 uuid[16];
|
|
|
|
u8 parent_uuid[16];
|
|
|
|
__le32 flags;
|
|
|
|
__le16 version_major;
|
|
|
|
__le16 version_minor;
|
2016-03-03 20:38:00 +03:00
|
|
|
__le64 dataoff; /* relative to namespace_base + start_pad */
|
2015-07-31 00:57:47 +03:00
|
|
|
__le64 npfns;
|
|
|
|
__le32 mode;
|
2016-03-03 20:38:00 +03:00
|
|
|
/* minor-version-1 additions for section alignment */
|
2020-02-28 08:39:23 +03:00
|
|
|
/**
|
|
|
|
* @start_pad: Deprecated attribute to pad start-misaligned namespaces
|
|
|
|
*
|
|
|
|
* start_pad is deprecated because the original definition did
|
|
|
|
* not comprehend that dataoff is relative to the base address
|
|
|
|
* of the namespace not the start_pad adjusted base. The result
|
|
|
|
* is that the dax path is broken, but the block-I/O path is
|
|
|
|
* not. The kernel will no longer create namespaces using start
|
|
|
|
* padding, but it still supports block-I/O for legacy
|
|
|
|
* configurations mainly to allow a backup, reconfigure the
|
|
|
|
* namespace, and restore flow to repair dax operation.
|
|
|
|
*/
|
2016-03-03 20:38:00 +03:00
|
|
|
__le32 start_pad;
|
|
|
|
__le32 end_trunc;
|
2016-04-01 01:41:18 +03:00
|
|
|
/* minor-version-2 record the base alignment of the mapping */
|
|
|
|
__le32 align;
|
2019-07-19 01:58:36 +03:00
|
|
|
/* minor-version-3 guarantee the padding and flags are zero */
|
2019-09-05 18:46:00 +03:00
|
|
|
/* minor-version-4 record the page size and struct page size */
|
|
|
|
__le32 page_size;
|
|
|
|
__le16 page_struct_size;
|
|
|
|
u8 padding[3994];
|
2015-07-31 00:57:47 +03:00
|
|
|
__le64 checksum;
|
|
|
|
};
|
2016-03-03 20:14:36 +03:00
|
|
|
|
2015-07-31 00:57:47 +03:00
|
|
|
#endif /* __NVDIMM_PFN_H */
|