cleaner: Move sort functionality to flush_data abstraction
The flush_data is used by ocf_cleaner_do_flush_data_async(), which means that callers of ocf_cleaner_fire() are now expected to guarantee that entries are returned by getter in a sorted order. Currently the only case when ocf_cleaner_fire() is called directly is for request cleaning, and the request map is sorted by definition. Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
@@ -652,7 +652,6 @@ static void _acp_flush(struct acp_context *acp)
|
||||
.cmpl_fn = _acp_flush_end,
|
||||
.lock_cacheline = false,
|
||||
.lock_metadata = true,
|
||||
.do_sort = false,
|
||||
.cmpl_queue = true,
|
||||
.io_queue = cache->cleaner.io_queue,
|
||||
};
|
||||
|
@@ -911,8 +911,9 @@ static void alru_clean(struct alru_context *ctx)
|
||||
to_clean = get_data_to_flush(ctx);
|
||||
if (to_clean > 0) {
|
||||
fctx->flush_perfomed = true;
|
||||
ocf_cleaner_do_flush_data_async(cache, fctx->flush_data, to_clean,
|
||||
&fctx->attribs);
|
||||
ocf_cleaner_sort_flush_data(fctx->flush_data, to_clean);
|
||||
ocf_cleaner_do_flush_data_async(cache, fctx->flush_data,
|
||||
to_clean, &fctx->attribs);
|
||||
ocf_metadata_end_exclusive_access(&cache->metadata.lock);
|
||||
return;
|
||||
}
|
||||
@@ -940,7 +941,6 @@ void cleaning_alru_perform_cleaning(ocf_cache_t cache, ocf_cleaner_end_t cmpl)
|
||||
fctx->attribs.cmpl_fn = alru_clean_complete;
|
||||
fctx->attribs.lock_cacheline = true;
|
||||
fctx->attribs.lock_metadata = false;
|
||||
fctx->attribs.do_sort = true;
|
||||
fctx->attribs.io_queue = cache->cleaner.io_queue;
|
||||
fctx->attribs.cmpl_queue = true;
|
||||
|
||||
|
Reference in New Issue
Block a user