From 0df0eec7f0df3a5698c49c0e52e648be4137c848 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Wed, 14 Aug 2024 07:25:00 +0200 Subject: [PATCH] Uncouple lookup() and set_hot() Signed-off-by: Michal Mielewczyk --- src/engine/engine_common.c | 4 ++-- src/engine/engine_common.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/engine/engine_common.c b/src/engine/engine_common.c index c974833..c12bd0d 100644 --- a/src/engine/engine_common.c +++ b/src/engine/engine_common.c @@ -185,7 +185,7 @@ static void ocf_engine_update_req_info(struct ocf_cache *cache, req->info.seq_no++; } -static void ocf_engine_set_hot(struct ocf_request *req) +void ocf_engine_set_hot(struct ocf_request *req) { struct ocf_cache *cache = req->cache; struct ocf_map_info *entry; @@ -208,7 +208,7 @@ static void ocf_engine_set_hot(struct ocf_request *req) } } -static void ocf_engine_lookup(struct ocf_request *req) +void ocf_engine_lookup(struct ocf_request *req) { uint32_t i; uint64_t core_line; diff --git a/src/engine/engine_common.h b/src/engine/engine_common.h index 6c6946e..4474a22 100644 --- a/src/engine/engine_common.h +++ b/src/engine/engine_common.h @@ -234,6 +234,15 @@ struct ocf_engine_callbacks */ int ocf_engine_prepare_clines(struct ocf_request *req); +/** +* @brief Check if the OCF request is mapped to cache (lookup cache) +* +* @note This function checks if there is a HIT without updating hotness info +* +* @param req OCF request +*/ +void ocf_engine_lookup(struct ocf_request *req); + /** * @brief Traverse OCF request (lookup cache) * @@ -285,4 +294,6 @@ void inc_fallback_pt_error_counter(ocf_cache_t cache); void ocf_engine_on_resume(struct ocf_request *req); +void ocf_engine_set_hot(struct ocf_request *req); + #endif /* ENGINE_COMMON_H_ */