diff --git a/src/concurrency/ocf_cache_line_concurrency.h b/src/concurrency/ocf_cache_line_concurrency.h index b42d164..ece2079 100644 --- a/src/concurrency/ocf_cache_line_concurrency.h +++ b/src/concurrency/ocf_cache_line_concurrency.h @@ -1,5 +1,6 @@ /* * Copyright(c) 2012-2021 Intel Corporation + * Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ @@ -111,23 +112,6 @@ void ocf_req_unlock_rd(struct ocf_alock *c, void ocf_req_unlock(struct ocf_alock *c, struct ocf_request *req); -/** - * @Check if cache line is used. - * - * Cache line is used when: - * 1. It is locked for write or read access - * or - * 2. There is set locked bit in metadata - * - * @param cache - OCF cache instance - * @param line - Cache line to be unlocked - * - * @retval true - cache line is used - * @retval false - cache line is not used - */ -bool ocf_cache_line_is_used(struct ocf_alock *c, - ocf_cache_line_t line); - /** * @brief Check if for specified cache line there are waiters * on the waiting list diff --git a/src/utils/utils_alock.h b/src/utils/utils_alock.h index 4fb5fe2..8a36a63 100644 --- a/src/utils/utils_alock.h +++ b/src/utils/utils_alock.h @@ -1,5 +1,6 @@ /* * Copyright(c) 2012-2022 Intel Corporation + * Copyright(c) 2024 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ #ifndef OCF_UTILS_ALOCK_H_ @@ -54,6 +55,23 @@ int ocf_alock_lock_rd(struct ocf_alock *alock, int ocf_alock_lock_wr(struct ocf_alock *alock, struct ocf_request *req, ocf_req_async_lock_cb cmpl); +/** + * @Check if cache line is used. + * + * Cache line is used when: + * 1. It is locked for write or read access + * or + * 2. There is set locked bit in metadata + * + * @param cache - OCF cache instance + * @param line - Cache line to be unlocked + * + * @retval true - cache line is used + * @retval false - cache line is not used + */ +bool ocf_cache_line_is_used(struct ocf_alock *c, + ocf_cache_line_t line); + bool ocf_alock_waitlist_is_empty(struct ocf_alock *alock, ocf_cache_line_t entry);