Introduce ocf_cache_is_passive()

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2021-08-31 10:20:52 +02:00
parent c662649f31
commit f96451a698
2 changed files with 16 additions and 0 deletions

View File

@ -151,6 +151,16 @@ bool ocf_cache_is_device_attached(ocf_cache_t cache);
*/
bool ocf_cache_is_running(ocf_cache_t cache);
/**
* @brief Check if cache object is passive
*
* @param[in] cache Cache object
*
* @retval 1 Caching device is in passive state
* @retval 0 Caching device is not in passive state
*/
bool ocf_cache_is_passive(ocf_cache_t cache);
/**
* @brief Get cache mode of given cache object
*

View File

@ -56,6 +56,12 @@ bool ocf_cache_is_running(ocf_cache_t cache)
return env_bit_test(ocf_cache_state_running, &cache->cache_state);
}
bool ocf_cache_is_passive(ocf_cache_t cache)
{
OCF_CHECK_NULL(cache);
return env_bit_test(ocf_cache_state_passive, &cache->cache_state);
}
bool ocf_cache_is_device_attached(ocf_cache_t cache)
{
OCF_CHECK_NULL(cache);