Introduce passive cache state

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2021-08-11 19:53:07 +02:00
parent ee42d9aaaf
commit 1fd9a448d4
6 changed files with 269 additions and 18 deletions

View File

@@ -103,6 +103,15 @@ struct ocf_cache_info {
*/
ocf_volume_t ocf_cache_get_volume(ocf_cache_t cache);
/**
* @brief Obtain front volume from cache
*
* @param[in] cache Cache object
*
* @retval Volume, NULL if dettached.
*/
ocf_volume_t ocf_cache_get_front_volume(ocf_cache_t cache);
/**
* @brief Get name of given cache object
*

View File

@@ -124,6 +124,9 @@ typedef enum {
ocf_cache_state_incomplete = 3, //!< ocf_cache_state_incomplete
/*!< OCF cache has at least one inactive core */
ocf_cache_state_passive = 4, //!< ocf_cache_state_passive
/*!< OCF is currently in passive mode */
ocf_cache_state_max //!< ocf_cache_state_max
/*!< Stopper of cache state enumerator */
} ocf_cache_state_t;

View File

@@ -514,6 +514,28 @@ void ocf_mngt_cache_load(ocf_cache_t cache,
struct ocf_mngt_cache_device_config *cfg,
ocf_mngt_cache_load_end_t cmpl, void *priv);
/**
* @brief Completion callback of cache bind operation
*
* @param[in] cache Cache handle
* @param[in] priv Callback context
* @param[in] error Error code (zero on success)
*/
typedef void (*ocf_mngt_cache_bind_end_t)(ocf_cache_t cache,
void *priv, int error);
/**
* @brief Bind cache instance
*
* @param[in] cache Cache handle
* @param[in] cfg Caching device configuration
* @param[in] cmpl Completion callback
* @param[in] priv Completion callback context
*/
void ocf_mngt_cache_bind(ocf_cache_t cache,
struct ocf_mngt_cache_device_config *cfg,
ocf_mngt_cache_bind_end_t cmpl, void *priv);
/* Adding and removing cores */
/**