| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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. |
|---|
| 12 | 4 | */ |
|---|
| 13 | 5 | |
|---|
| 14 | 6 | #ifndef __NVDIMM_PFN_H |
|---|
| .. | .. |
|---|
| 32 | 24 | __le64 npfns; |
|---|
| 33 | 25 | __le32 mode; |
|---|
| 34 | 26 | /* 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 | + */ |
|---|
| 35 | 39 | __le32 start_pad; |
|---|
| 36 | 40 | __le32 end_trunc; |
|---|
| 37 | 41 | /* minor-version-2 record the base alignment of the mapping */ |
|---|
| 38 | 42 | __le32 align; |
|---|
| 39 | 43 | /* 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]; |
|---|
| 41 | 48 | __le64 checksum; |
|---|
| 42 | 49 | }; |
|---|
| 43 | 50 | |
|---|
| 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))) |
|---|
| 58 | 51 | #endif /* __NVDIMM_PFN_H */ |
|---|