pyocf: Add helper for superblock size

Signed-off-by: Jan Musial <jan.musial@intel.com>
This commit is contained in:
Jan Musial 2022-07-15 09:01:34 +02:00
parent eac7d64456
commit 2aaa69b33b

View File

@ -1,5 +1,5 @@
/*
* Copyright(c) 2022-2022 Intel Corporation
* Copyright(c) 2022 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -8,6 +8,7 @@
#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;
}