Rename cache "initializing" state to "detached"
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
parent
d3c11a983b
commit
047e07c062
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright(c) 2012-2021 Intel Corporation
|
* Copyright(c) 2012-2021 Intel Corporation
|
||||||
* Copyright(c) 2023 Huawei Technologies
|
* Copyright(c) 2023-2024 Huawei Technologies
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -156,14 +156,14 @@ bool ocf_cache_is_device_attached(ocf_cache_t cache);
|
|||||||
bool ocf_cache_is_running(ocf_cache_t cache);
|
bool ocf_cache_is_running(ocf_cache_t cache);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if cache object is initializing
|
* @brief Check if cache is detached
|
||||||
*
|
*
|
||||||
* @param[in] cache Cache object
|
* @param[in] cache Cache
|
||||||
*
|
*
|
||||||
* @retval 1 Caching device is initializing
|
* @retval 1 Caching device is detached
|
||||||
* @retval 0 Caching device is not initializing
|
* @retval 0 Caching device is not detached
|
||||||
*/
|
*/
|
||||||
bool ocf_cache_is_initializing(ocf_cache_t cache);
|
bool ocf_cache_is_detached(ocf_cache_t cache);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if cache object is standby
|
* @brief Check if cache object is standby
|
||||||
|
@ -119,8 +119,8 @@ typedef enum {
|
|||||||
ocf_cache_state_stopping = 1, //!< ocf_cache_state_stopping
|
ocf_cache_state_stopping = 1, //!< ocf_cache_state_stopping
|
||||||
/*!< OCF cache instance is stopping */
|
/*!< OCF cache instance is stopping */
|
||||||
|
|
||||||
ocf_cache_state_initializing = 2, //!< ocf_cache_state_initializing
|
ocf_cache_state_detached = 2, //!< ocf_cache_state_detached
|
||||||
/*!< OCF cache instance during initialization */
|
/*!< OCF cache instance without caching device attached */
|
||||||
|
|
||||||
ocf_cache_state_incomplete = 3, //!< ocf_cache_state_incomplete
|
ocf_cache_state_incomplete = 3, //!< ocf_cache_state_incomplete
|
||||||
/*!< OCF cache has at least one inactive core */
|
/*!< OCF cache has at least one inactive core */
|
||||||
|
@ -856,7 +856,7 @@ static int _ocf_mngt_init_new_cache(struct ocf_cache_mngt_init_params *params)
|
|||||||
env_atomic_set(&(cache->last_access_ms),
|
env_atomic_set(&(cache->last_access_ms),
|
||||||
env_ticks_to_msecs(env_get_tick_count()));
|
env_ticks_to_msecs(env_get_tick_count()));
|
||||||
|
|
||||||
env_bit_set(ocf_cache_state_initializing, &cache->cache_state);
|
env_bit_set(ocf_cache_state_detached, &cache->cache_state);
|
||||||
|
|
||||||
params->cache = cache;
|
params->cache = cache;
|
||||||
params->flags.cache_alloc = true;
|
params->flags.cache_alloc = true;
|
||||||
@ -1552,7 +1552,7 @@ static void _ocf_mngt_cache_set_valid(ocf_cache_t cache)
|
|||||||
* Clear initialization state and set the valid bit so we know
|
* Clear initialization state and set the valid bit so we know
|
||||||
* its in use.
|
* its in use.
|
||||||
*/
|
*/
|
||||||
env_bit_clear(ocf_cache_state_initializing, &cache->cache_state);
|
env_bit_clear(ocf_cache_state_detached, &cache->cache_state);
|
||||||
env_bit_set(ocf_cache_state_running, &cache->cache_state);
|
env_bit_set(ocf_cache_state_running, &cache->cache_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1561,7 +1561,7 @@ static void _ocf_mngt_cache_set_standby(ocf_cache_t cache)
|
|||||||
/*
|
/*
|
||||||
* Clear initialization state and set the standby bit.
|
* Clear initialization state and set the standby bit.
|
||||||
*/
|
*/
|
||||||
env_bit_clear(ocf_cache_state_initializing, &cache->cache_state);
|
env_bit_clear(ocf_cache_state_detached, &cache->cache_state);
|
||||||
env_bit_set(ocf_cache_state_standby, &cache->cache_state);
|
env_bit_set(ocf_cache_state_standby, &cache->cache_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3352,7 +3352,7 @@ void ocf_mngt_cache_stop(ocf_cache_t cache,
|
|||||||
|
|
||||||
if (!ocf_cache_is_device_attached(cache)) {
|
if (!ocf_cache_is_device_attached(cache)) {
|
||||||
env_bit_set(ocf_cache_state_stopping, &cache->cache_state);
|
env_bit_set(ocf_cache_state_stopping, &cache->cache_state);
|
||||||
env_bit_clear(ocf_cache_state_initializing, &cache->cache_state);
|
env_bit_clear(ocf_cache_state_detached, &cache->cache_state);
|
||||||
ocf_mngt_cache_stop_detached(cache, cmpl, priv);
|
ocf_mngt_cache_stop_detached(cache, cmpl, priv);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright(c) 2012-2022 Intel Corporation
|
* Copyright(c) 2012-2022 Intel Corporation
|
||||||
* Copyright(c) 2023 Huawei Technologies
|
* Copyright(c) 2023-2024 Huawei Technologies
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -74,10 +74,10 @@ bool ocf_cache_is_running(ocf_cache_t cache)
|
|||||||
return env_bit_test(ocf_cache_state_running, &cache->cache_state);
|
return env_bit_test(ocf_cache_state_running, &cache->cache_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ocf_cache_is_initializing(ocf_cache_t cache)
|
bool ocf_cache_is_detached(ocf_cache_t cache)
|
||||||
{
|
{
|
||||||
OCF_CHECK_NULL(cache);
|
OCF_CHECK_NULL(cache);
|
||||||
return env_bit_test(ocf_cache_state_initializing, &cache->cache_state);
|
return env_bit_test(ocf_cache_state_detached, &cache->cache_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ocf_cache_is_standby(ocf_cache_t cache)
|
bool ocf_cache_is_standby(ocf_cache_t cache)
|
||||||
|
Loading…
Reference in New Issue
Block a user