Refactor cache_trylock()

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
Michal Mielewczyk 2024-04-09 10:32:50 +02:00
parent 421d3f03ea
commit a542cfa690

View File

@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -275,10 +276,10 @@ static int _ocf_mngt_cache_trylock(ocf_cache_t cache,
if (env_bit_test(ocf_cache_state_stopping, &cache->cache_state)) {
/* Cache already stopping, do not allow any operation */
unlock_fn(&cache->lock);
return -OCF_ERR_CACHE_NOT_EXIST;
result = -OCF_ERR_CACHE_NOT_EXIST;
}
return 0;
return result;
}
static void _ocf_mngt_cache_unlock(ocf_cache_t cache,