Combine cache ref counter and valid flag into ocf_refcnt

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
Adam Rutkowski
2019-04-10 15:59:21 -04:00
parent 4251cc63e7
commit aafc067fa5
3 changed files with 15 additions and 21 deletions

View File

@@ -146,13 +146,10 @@ struct ocf_cache {
ocf_ctx_t owner;
struct list_head list;
/* set to make valid */
uint8_t valid_ocf_cache_device_t;
/* unset running to not serve any more I/O requests */
unsigned long cache_state;
env_atomic ref_count;
struct ocf_superblock_config *conf_meta;
struct ocf_cache_device *device;
@@ -169,8 +166,14 @@ struct ocf_cache {
char name[OCF_CACHE_NAME_SIZE];
struct {
/* cache get/put counter */
struct ocf_refcnt cache;
/* # of requests potentially dirtying cachelines */
struct ocf_refcnt dirty;
/* # of requests accessing attached metadata, excluding
* management reqs */
struct ocf_refcnt metadata;
/* # of forced cleaning requests (eviction path) */
struct ocf_refcnt cleaning[OCF_IO_CLASS_MAX];
} refcnt;