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