Refactor cache_trylock()
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
parent
421d3f03ea
commit
a542cfa690
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright(c) 2012-2021 Intel Corporation
|
* Copyright(c) 2012-2021 Intel Corporation
|
||||||
|
* Copyright(c) 2024 Huawei Technologies
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* 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)) {
|
if (env_bit_test(ocf_cache_state_stopping, &cache->cache_state)) {
|
||||||
/* Cache already stopping, do not allow any operation */
|
/* Cache already stopping, do not allow any operation */
|
||||||
unlock_fn(&cache->lock);
|
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,
|
static void _ocf_mngt_cache_unlock(ocf_cache_t cache,
|
||||||
|
Loading…
Reference in New Issue
Block a user