Write-only cache mode
Write-only cache mode is similar to writeback, however read operations do not promote data to cache. Reads are mostly serviced by the core device, only dirty sectors are fetched from the cache. Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#define ENGINE_COMMON_H_
|
||||
|
||||
#include "../ocf_request.h"
|
||||
#include "../utils/utils_cache_line.h"
|
||||
|
||||
/**
|
||||
* @file engine_common.h
|
||||
@@ -109,6 +110,37 @@ static inline uint32_t ocf_engine_io_count(struct ocf_request *req)
|
||||
return req->info.seq_req ? 1 : req->core_line_count;
|
||||
}
|
||||
|
||||
static inline
|
||||
bool ocf_engine_map_all_sec_dirty(struct ocf_request *req, uint32_t line)
|
||||
{
|
||||
uint8_t start = ocf_map_line_start_sector(req, line);
|
||||
uint8_t end = ocf_map_line_end_sector(req, line);
|
||||
|
||||
if (req->map[line].status != LOOKUP_HIT)
|
||||
return false;
|
||||
|
||||
return metadata_test_dirty_all_sec(req->cache, req->map[line].coll_idx,
|
||||
start, end);
|
||||
}
|
||||
|
||||
static inline
|
||||
bool ocf_engine_map_all_sec_clean(struct ocf_request *req, uint32_t line)
|
||||
{
|
||||
uint8_t start = ocf_map_line_start_sector(req, line);
|
||||
uint8_t end = ocf_map_line_end_sector(req, line);
|
||||
|
||||
if (req->map[line].status != LOOKUP_HIT)
|
||||
return false;
|
||||
|
||||
if (!metadata_test_valid_sec(req->cache, req->map[line].coll_idx,
|
||||
start, end)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !metadata_test_dirty_sec(req->cache, req->map[line].coll_idx,
|
||||
start, end);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clean request (flush dirty data to the core device)
|
||||
*
|
||||
|
Reference in New Issue
Block a user