Merge pull request #802 from mmichal10/fix-cleaner-refcnt
cleaner: Fix tracking in-flight cache requests
This commit is contained in:
commit
63f4a373ec
@ -683,7 +683,7 @@ static int _ocf_cleaner_fire_cache(struct ocf_request *req)
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
/* Protect IO completion race */
|
/* Protect IO completion race */
|
||||||
env_atomic_inc(&req->req_remaining);
|
env_atomic_set(&req->req_remaining, 1);
|
||||||
|
|
||||||
for (i = 0; i < req->core_line_count; i++, iter++) {
|
for (i = 0; i < req->core_line_count; i++, iter++) {
|
||||||
core = ocf_cache_get_core(cache, iter->core_id);
|
core = ocf_cache_get_core(cache, iter->core_id);
|
||||||
@ -725,6 +725,8 @@ static int _ocf_cleaner_fire_cache(struct ocf_request *req)
|
|||||||
ocf_core_stats_cache_block_update(core, part_id, OCF_READ,
|
ocf_core_stats_cache_block_update(core, part_id, OCF_READ,
|
||||||
ocf_line_size(cache));
|
ocf_line_size(cache));
|
||||||
|
|
||||||
|
env_atomic_inc(&req->req_remaining);
|
||||||
|
|
||||||
ocf_volume_submit_io(io);
|
ocf_volume_submit_io(io);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,9 +767,6 @@ static int _ocf_cleaner_do_fire(struct ocf_request *req, uint32_t count)
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
/* Set counts of cache IOs */
|
|
||||||
env_atomic_set(&req->req_remaining, count);
|
|
||||||
|
|
||||||
req->engine_handler = _ocf_cleaner_check_map;
|
req->engine_handler = _ocf_cleaner_check_map;
|
||||||
req->core_line_count = count;
|
req->core_line_count = count;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user