hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/nvdimm/pfn.h
....@@ -1,14 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (c) 2014-2015, Intel Corporation.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
124 */
135
146 #ifndef __NVDIMM_PFN_H
....@@ -32,27 +24,28 @@
3224 __le64 npfns;
3325 __le32 mode;
3426 /* minor-version-1 additions for section alignment */
27
+ /**
28
+ * @start_pad: Deprecated attribute to pad start-misaligned namespaces
29
+ *
30
+ * start_pad is deprecated because the original definition did
31
+ * not comprehend that dataoff is relative to the base address
32
+ * of the namespace not the start_pad adjusted base. The result
33
+ * is that the dax path is broken, but the block-I/O path is
34
+ * not. The kernel will no longer create namespaces using start
35
+ * padding, but it still supports block-I/O for legacy
36
+ * configurations mainly to allow a backup, reconfigure the
37
+ * namespace, and restore flow to repair dax operation.
38
+ */
3539 __le32 start_pad;
3640 __le32 end_trunc;
3741 /* minor-version-2 record the base alignment of the mapping */
3842 __le32 align;
3943 /* minor-version-3 guarantee the padding and flags are zero */
40
- u8 padding[4000];
44
+ /* minor-version-4 record the page size and struct page size */
45
+ __le32 page_size;
46
+ __le16 page_struct_size;
47
+ u8 padding[3994];
4148 __le64 checksum;
4249 };
4350
44
-#ifdef CONFIG_SPARSEMEM
45
-#define PFN_SECTION_ALIGN_DOWN(x) SECTION_ALIGN_DOWN(x)
46
-#define PFN_SECTION_ALIGN_UP(x) SECTION_ALIGN_UP(x)
47
-#else
48
-/*
49
- * In this case ZONE_DEVICE=n and we will disable 'pfn' device support,
50
- * but we still want pmem to compile.
51
- */
52
-#define PFN_SECTION_ALIGN_DOWN(x) (x)
53
-#define PFN_SECTION_ALIGN_UP(x) (x)
54
-#endif
55
-
56
-#define PHYS_SECTION_ALIGN_DOWN(x) PFN_PHYS(PFN_SECTION_ALIGN_DOWN(PHYS_PFN(x)))
57
-#define PHYS_SECTION_ALIGN_UP(x) PFN_PHYS(PFN_SECTION_ALIGN_UP(PHYS_PFN(x)))
5851 #endif /* __NVDIMM_PFN_H */