From 2aaa69b33b1e4143837536d421704d16ebd595cf Mon Sep 17 00:00:00 2001 From: Jan Musial Date: Fri, 15 Jul 2022 09:01:34 +0200 Subject: [PATCH] pyocf: Add helper for superblock size Signed-off-by: Jan Musial --- tests/functional/pyocf/c/helpers/metadata_helpers.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/functional/pyocf/c/helpers/metadata_helpers.c b/tests/functional/pyocf/c/helpers/metadata_helpers.c index 5323dc5..aceb25c 100644 --- a/tests/functional/pyocf/c/helpers/metadata_helpers.c +++ b/tests/functional/pyocf/c/helpers/metadata_helpers.c @@ -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; }