pyocf: Add helper for superblock size
/*
- * Copyright(c) 2022-2022 Intel Corporation
+ * Copyright(c) 2022 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "../src/ocf/ocf_cache_priv.h"
#include "../src/ocf/metadata/metadata_raw.h"
#include "../src/ocf/metadata/metadata_internal.h"
+#include "../src/ocf/metadata/metadata_superblock.h"
uint64_t ocf_get_metadata_segment_start_page(ocf_cache_t cache, int segment)
{
@@ -46,6 +47,9 @@ uint64_t ocf_get_metadata_segment_elem_size(ocf_cache_t cache, int segment)
struct ocf_metadata_ctrl *ctrl = cache->metadata.priv;
struct ocf_metadata_raw *raw = &ctrl->raw_desc[segment];
+ if (segment == metadata_segment_sb_config)
+ return offsetof(struct ocf_superblock_config, checksum);
+
return raw->entry_size;
}
