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

@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -18,4 +19,6 @@ struct ocf_dbg_seq_cutoff_status {
void ocf_dbg_get_seq_cutoff_status(ocf_core_t core,
struct ocf_dbg_seq_cutoff_status *status);
bool ocf_dbg_cache_is_settled(ocf_cache_t cache);
#endif /* __OCF_DEBUG_H__ */

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);
}