Skip to content

Commit

Permalink
Merge pull request #774 from robertbaldyga/v22.6.1-cache-is-initializing
Browse files Browse the repository at this point in the history
[v22.6.1] Add OCF API ocf_cache_is_initializing
  • Loading branch information
Robert Baldyga committed Mar 30, 2023
2 parents e2c02af + 90a78be commit 5205b15
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions inc/ocf_cache.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* Copyright(c) 2023 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -154,6 +155,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 initializing
*
* @param[in] cache Cache object
*
* @retval 1 Caching device is initializing
* @retval 0 Caching device is not initializing
*/
bool ocf_cache_is_initializing(ocf_cache_t cache);

/**
* @brief Check if cache object is standby
*
Expand Down
7 changes: 7 additions & 0 deletions src/ocf_cache.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* Copyright(c) 2023 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -62,6 +63,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_initializing(ocf_cache_t cache)
{
OCF_CHECK_NULL(cache);
return env_bit_test(ocf_cache_state_initializing, &cache->cache_state);
}

bool ocf_cache_is_standby(ocf_cache_t cache)
{
OCF_CHECK_NULL(cache);
Expand Down

0 comments on commit 5205b15

Please sign in to comment.