From 600bd1d8590fe48207717547604f0ff46de1492f Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Fri, 13 Nov 2020 01:47:22 -0500 Subject: [PATCH] Access partition's metadata counters via functions Signed-off-by: Michal Mielewczyk --- src/utils/utils_part.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/utils/utils_part.h b/src/utils/utils_part.h index fcf63da..6f951f7 100644 --- a/src/utils/utils_part.h +++ b/src/utils/utils_part.h @@ -50,6 +50,17 @@ static inline ocf_part_id_t ocf_part_class2id(ocf_cache_t cache, uint64_t class) return PARTITION_DEFAULT; } +static inline uint32_t ocf_part_get_occupancy(struct ocf_user_part *part) +{ + return part->runtime->curr_size; +} + +static inline uint32_t ocf_part_get_max_size(ocf_cache_t cache, + ocf_part_id_t part_id) +{ + return cache->user_parts[part_id].config->max_size; +} + void ocf_part_move(struct ocf_request *req); #define for_each_part(cache, part, id) \