commit
ebbf832cdc
@ -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__ */
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright(c) 2019-2021 Intel Corporation
|
||||
* Copyright(c) 2024 Huawei Technologies
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
@ -68,3 +69,8 @@ bool ocf_refcnt_frozen(struct ocf_refcnt *rc)
|
||||
{
|
||||
return !!env_atomic_read(&rc->freeze);
|
||||
}
|
||||
|
||||
bool ocf_refcnt_zeroed(struct ocf_refcnt *rc)
|
||||
{
|
||||
return (env_atomic_read(&rc->counter) == 0);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright(c) 2019-2021 Intel Corporation
|
||||
* Copyright(c) 2024 Huawei Technologies
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
@ -40,6 +41,8 @@ void ocf_refcnt_unfreeze(struct ocf_refcnt *rc);
|
||||
|
||||
bool ocf_refcnt_frozen(struct ocf_refcnt *rc);
|
||||
|
||||
bool ocf_refcnt_zeroed(struct ocf_refcnt *rc);
|
||||
|
||||
/* Register callback to be called when reference counter drops to 0.
|
||||
* Must be called after counter is frozen.
|
||||
* Cannot be called until previously regsitered callback had fired. */
|
||||
|
@ -1010,7 +1010,8 @@ class Cache:
|
||||
|
||||
# settle all queues accociated with this cache (mngt and I/O)
|
||||
def settle(self):
|
||||
Queue.settle_many(self.io_queues + [self.mngt_queue])
|
||||
while not self.owner.lib.ocf_dbg_cache_is_settled(self.cache_handle):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def get_by_name(cache_name, owner=None):
|
||||
|
Loading…
Reference in New Issue
Block a user