xref: /spdk/lib/ftl/ftl_sb_current.h (revision 877573897ad52be4fa8989f7617bd655b87e05c4)
1 /*   SPDX-License-Identifier: BSD-3-Clause
2  *   Copyright (C) 2022 Intel Corporation.
3  *   All rights reserved.
4  */
5 
6 #ifndef FTL_SB_CURRENT_H
7 #define FTL_SB_CURRENT_H
8 
9 #include "spdk/uuid.h"
10 #include "ftl_sb_common.h"
11 
12 #define FTL_SB_VERSION_4			4
13 #define FTL_SB_VERSION_CURRENT			FTL_SB_VERSION_4
14 
15 struct ftl_superblock {
16 	struct ftl_superblock_header	header;
17 
18 	struct spdk_uuid		uuid;
19 
20 	/* Current sequence number */
21 	uint64_t			seq_id;
22 
23 	/* Flag describing clean shutdown */
24 	uint64_t			clean;
25 
26 	/* Number of surfaced LBAs */
27 	uint64_t			lba_cnt;
28 
29 	/* Percentage of base device blocks not exposed to the user */
30 	uint64_t			overprovisioning;
31 
32 	/* Maximum IO depth per band relocate */
33 	uint64_t			max_reloc_qdepth;
34 
35 	/* Reserved field */
36 	uint8_t				reserved3[16];
37 
38 	/* Last L2P checkpoint +1 (i.e. min_seq_id, 0:no ckpt) */
39 	uint64_t			ckpt_seq_id;
40 
41 	struct ftl_superblock_gc_info	gc_info;
42 
43 	struct ftl_superblock_md_region	md_layout_head;
44 } __attribute__((packed));
45 
46 SPDK_STATIC_ASSERT(offsetof(struct ftl_superblock, header) == 0,
47 		   "Invalid placement of header");
48 
49 SPDK_STATIC_ASSERT(FTL_SUPERBLOCK_SIZE >= sizeof(struct ftl_superblock),
50 		   "FTL SB metadata size is invalid");
51 
52 #endif /* FTL_SB_CURRENT_H */
53