Use ref counter to track attach state

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2019-04-09 14:22:33 -04:00
parent 979f51612f
commit dc716d6a08
7 changed files with 29 additions and 44 deletions

View File

@@ -158,7 +158,7 @@ bool ocf_fallback_pt_is_on(ocf_cache_t cache)
static inline bool ocf_seq_cutoff_is_on(ocf_cache_t cache)
{
if (!env_atomic_read(&cache->attached))
if (!ocf_cache_is_device_attached(cache))
return false;
return (cache->device->freelist_part->curr_size <= SEQ_CUTOFF_FULL_MARGIN);