Refactor ocf_submit_cache_reqs map indexing
Refactoring ocf_submit_cache_reqs to make it clear that req->map is accessed at index derived from offset argument, not necesarily starting at 0. Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
parent
9088e52651
commit
9dc1381b77
@ -236,12 +236,11 @@ void ocf_submit_cache_reqs(struct ocf_cache *cache,
|
|||||||
struct ocf_io *io;
|
struct ocf_io *io;
|
||||||
int err;
|
int err;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
uint32_t entry = ocf_bytes_2_lines(cache, req->byte_position + offset) -
|
uint32_t first_cl = ocf_bytes_2_lines(cache, req->byte_position +
|
||||||
ocf_bytes_2_lines(cache, req->byte_position);
|
offset) - ocf_bytes_2_lines(cache, req->byte_position);
|
||||||
struct ocf_map_info *map_info = &req->map[entry];
|
|
||||||
|
|
||||||
ENV_BUG_ON(req->byte_length < offset + size);
|
ENV_BUG_ON(req->byte_length < offset + size);
|
||||||
ENV_BUG_ON(entry + reqs > req->core_line_count);
|
ENV_BUG_ON(first_cl + reqs > req->core_line_count);
|
||||||
|
|
||||||
cache_stats = &req->core->counters->cache_blocks;
|
cache_stats = &req->core->counters->cache_blocks;
|
||||||
|
|
||||||
@ -253,7 +252,7 @@ void ocf_submit_cache_reqs(struct ocf_cache *cache,
|
|||||||
}
|
}
|
||||||
|
|
||||||
addr = ocf_metadata_map_lg2phy(cache,
|
addr = ocf_metadata_map_lg2phy(cache,
|
||||||
map_info[0].coll_idx);
|
req->map[first_cl].coll_idx);
|
||||||
addr *= ocf_line_size(cache);
|
addr *= ocf_line_size(cache);
|
||||||
addr += cache->device->metadata_offset;
|
addr += cache->device->metadata_offset;
|
||||||
addr += ((req->byte_position + offset) % ocf_line_size(cache));
|
addr += ((req->byte_position + offset) % ocf_line_size(cache));
|
||||||
@ -288,7 +287,7 @@ void ocf_submit_cache_reqs(struct ocf_cache *cache,
|
|||||||
}
|
}
|
||||||
|
|
||||||
addr = ocf_metadata_map_lg2phy(cache,
|
addr = ocf_metadata_map_lg2phy(cache,
|
||||||
map_info[i].coll_idx);
|
req->map[first_cl + i].coll_idx);
|
||||||
addr *= ocf_line_size(cache);
|
addr *= ocf_line_size(cache);
|
||||||
addr += cache->device->metadata_offset;
|
addr += cache->device->metadata_offset;
|
||||||
bytes = ocf_line_size(cache);
|
bytes = ocf_line_size(cache);
|
||||||
|
Loading…
Reference in New Issue
Block a user