Add function to check for lazy write cache mode (WO or WB)

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2019-06-04 13:29:45 -04:00
parent a6312eb8aa
commit b97bb6f53b
4 changed files with 28 additions and 3 deletions

View File

@@ -695,6 +695,17 @@ typedef void (*ocf_mngt_cache_save_end_t)(ocf_cache_t cache,
void ocf_mngt_cache_save(ocf_cache_t cache,
ocf_mngt_cache_save_end_t cmpl, void *priv);
/**
* @brief Determines whether given cache mode has write-back semantics, i.e. it
* allows for writes to be serviced in cache and lazily propagated to core.
*
* @param[in] mode input cache mode
*/
static inline bool ocf_mngt_cache_mode_has_lazy_write(ocf_cache_mode_t mode)
{
return mode == ocf_cache_mode_wb || mode == ocf_cache_mode_wo;
}
/**
* @brief Set cache mode in given cache
*