Introduce ocf_refcnt_zeroed()
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com> Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
parent
1fbb00de8f
commit
f4d9f0dcf6
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright(c) 2019-2021 Intel Corporation
|
* Copyright(c) 2019-2021 Intel Corporation
|
||||||
|
* Copyright(c) 2024 Huawei Technologies
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -68,3 +69,8 @@ bool ocf_refcnt_frozen(struct ocf_refcnt *rc)
|
|||||||
{
|
{
|
||||||
return !!env_atomic_read(&rc->freeze);
|
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) 2019-2021 Intel Corporation
|
||||||
|
* Copyright(c) 2024 Huawei Technologies
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* 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_frozen(struct ocf_refcnt *rc);
|
||||||
|
|
||||||
|
bool ocf_refcnt_zeroed(struct ocf_refcnt *rc);
|
||||||
|
|
||||||
/* Register callback to be called when reference counter drops to 0.
|
/* Register callback to be called when reference counter drops to 0.
|
||||||
* Must be called after counter is frozen.
|
* Must be called after counter is frozen.
|
||||||
* Cannot be called until previously regsitered callback had fired. */
|
* Cannot be called until previously regsitered callback had fired. */
|
||||||
|
Loading…
Reference in New Issue
Block a user