Merge pull request #469 from mmichal10/fix-unmapped

Fix `ocf_engine_unmapped_count()`
This commit is contained in:
Michał Mielewczyk 2021-03-17 10:30:23 +01:00 committed by GitHub
commit e3d5439d9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -109,7 +109,8 @@ static inline uint32_t ocf_engine_mapped_count(struct ocf_request *req)
*/
static inline uint32_t ocf_engine_unmapped_count(struct ocf_request *req)
{
return req->core_line_count - (req->info.hit_no + req->info.invalid_no);
return req->core_line_count -
(req->info.hit_no + req->info.invalid_no + req->info.insert_no);
}
void ocf_map_cache_line(struct ocf_request *req,

View File

@ -683,6 +683,8 @@ uint32_t evp_lru_req_clines(struct ocf_request *req,
++req_idx;
++i;
/* Number of cachelines to evict have to match space in the request */
ENV_BUG_ON(req_idx == req->core_line_count && i != cline_no );
}
return i;