Introduce ocf_dbg_cache_is_settled()

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
Robert Baldyga
2024-02-05 10:36:23 +01:00
committed by Michal Mielewczyk
parent f4d9f0dcf6
commit 3ebdf38aa9
2 changed files with 10 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
#include "ocf_cache_priv.h"
#include "ocf_queue_priv.h"
#include "utils/utils_stats.h"
#include "ocf/ocf_debug.h"
ocf_volume_t ocf_cache_get_volume(ocf_cache_t cache)
{
@@ -559,3 +560,9 @@ int ocf_cache_volume_type_init(ocf_ctx_t ctx)
return ocf_ctx_register_volume_type_internal(ctx, OCF_VOLUME_TYPE_CACHE,
&ocf_cache_volume_properties, NULL);
}
bool ocf_dbg_cache_is_settled(ocf_cache_t cache)
{
return ocf_refcnt_zeroed(&cache->refcnt.metadata) &&
ocf_refcnt_zeroed(&cache->refcnt.d2c);
}