2019-05-29 22:18:02 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2015-07-31 05:57:47 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014-2015, Intel Corporation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __NVDIMM_PFN_H
|
|
|
|
#define __NVDIMM_PFN_H
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
2016-03-04 01:14:36 +08:00
|
|
|
#include <linux/mmzone.h>
|
2015-07-31 05:57:47 +08:00
|
|
|
|
|
|
|
#define PFN_SIG_LEN 16
|
|
|
|
#define PFN_SIG "NVDIMM_PFN_INFO\0"
|
2016-05-19 05:50:12 +08:00
|
|
|
#define DAX_SIG "NVDIMM_DAX_INFO\0"
|
2015-07-31 05:57:47 +08: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-04 01:38:00 +08:00
|
|
|
__le64 dataoff; /* relative to namespace_base + start_pad */
|
2015-07-31 05:57:47 +08:00
|
|
|
__le64 npfns;
|
|
|
|
__le32 mode;
|
2016-03-04 01:38:00 +08:00
|
|
|
/* minor-version-1 additions for section alignment */
|
2020-02-28 13:39:23 +08: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-04 01:38:00 +08:00
|
|
|
__le32 start_pad;
|
|
|
|
__le32 end_trunc;
|
2016-04-01 06:41:18 +08:00
|
|
|
/* minor-version-2 record the base alignment of the mapping */
|
|
|
|
__le32 align;
|
2019-07-19 06:58:36 +08:00
|
|
|
/* minor-version-3 guarantee the padding and flags are zero */
|
2019-09-05 23:46:00 +08: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 05:57:47 +08:00
|
|
|
__le64 checksum;
|
|
|
|
};
|
2016-03-04 01:14:36 +08:00
|
|
|
|
2015-07-31 05:57:47 +08:00
|
|
|
#endif /* __NVDIMM_PFN_H */
|