Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/engine/engine_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,12 @@ static inline void ocf_prepare_clines_miss(struct ocf_request *req)

int ocf_engine_prepare_clines(struct ocf_request *req)
{
struct ocf_user_part *user_part = &req->cache->user_parts[req->part_id];
struct ocf_cache *cache = req->cache;
struct ocf_user_part *user_part = &cache->user_parts[req->part_id];
bool mapped;
bool promote = true;
int lock = -OCF_ERR_NO_LOCK;
ocf_part_id_t part_id;

/* requests to disabled partitions go in pass-through */
if (!ocf_user_part_is_enabled(user_part)) {
Expand Down Expand Up @@ -500,7 +502,7 @@ int ocf_engine_prepare_clines(struct ocf_request *req)

/* check if request should promote cachelines */
promote = ocf_promotion_req_should_promote(
req->cache->promotion_policy, req);
cache->promotion_policy, req);
if (!promote) {
ocf_req_set_mapping_error(req);
ocf_hb_req_prot_unlock_rd(req);
Expand Down Expand Up @@ -536,8 +538,11 @@ int ocf_engine_prepare_clines(struct ocf_request *req)
ocf_hb_req_prot_unlock_wr(req);

if (ocf_req_is_cleaning_required(req)) {
ocf_lru_clean(req->cache, user_part, req->io_queue,
128);
for_each_user_part(cache, user_part, part_id) {
if (!ocf_user_part_is_valid(user_part))
continue;
ocf_lru_clean(cache, user_part, req->io_queue, 128);
}
}

return lock;
Expand Down
Loading