From 951b628fe5c2b3d09f76299821ab8fb03195027d Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Thu, 13 Dec 2018 07:49:27 +0100 Subject: [PATCH] Unify completion functions naming Signed-off-by: Robert Baldyga --- src/engine/engine_bf.c | 4 ++-- src/engine/engine_discard.c | 14 +++++++------- src/engine/engine_fast.c | 4 ++-- src/engine/engine_ops.c | 6 +++--- src/engine/engine_pt.c | 4 ++-- src/engine/engine_rd.c | 10 +++++----- src/engine/engine_wa.c | 4 ++-- src/engine/engine_wb.c | 4 ++-- src/engine/engine_wi.c | 4 ++-- src/engine/engine_wt.c | 16 ++++++++-------- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/engine/engine_bf.c b/src/engine/engine_bf.c index 8bb97d9..a63ac33 100644 --- a/src/engine/engine_bf.c +++ b/src/engine/engine_bf.c @@ -37,7 +37,7 @@ static inline void backfill_queue_inc_block(struct ocf_cache *cache) env_atomic_set(&cache->pending_read_misses_list_blocked, 1); } -static void _ocf_backfill_do_io(struct ocf_request *req, int error) +static void _ocf_backfill_complete(struct ocf_request *req, int error) { struct ocf_cache *cache = req->cache; @@ -87,7 +87,7 @@ static int _ocf_backfill_do(struct ocf_request *req) req->data = req->cp_data; ocf_submit_cache_reqs(req->cache, req->map, req, OCF_WRITE, reqs_to_issue, - _ocf_backfill_do_io); + _ocf_backfill_complete); return 0; } diff --git a/src/engine/engine_discard.c b/src/engine/engine_discard.c index 403919b..1d0e02f 100644 --- a/src/engine/engine_discard.c +++ b/src/engine/engine_discard.c @@ -49,7 +49,7 @@ static void _ocf_discard_complete_req(struct ocf_request *req, int error) ocf_req_put(req); } -static void _ocf_discard_core_io(struct ocf_io *io, int error) +static void _ocf_discard_core_complete(struct ocf_io *io, int error) { struct ocf_request *req = io->priv1; @@ -73,7 +73,7 @@ static int _ocf_discard_core(struct ocf_request *req) SECTORS_TO_BYTES(req->discard.nr_sects), OCF_WRITE, 0, 0); - ocf_io_set_cmpl(io, req, NULL, _ocf_discard_core_io); + ocf_io_set_cmpl(io, req, NULL, _ocf_discard_core_complete); ocf_io_set_data(io, req->data, 0); ocf_dobj_submit_discard(io); @@ -81,7 +81,7 @@ static int _ocf_discard_core(struct ocf_request *req) return 0; } -static void _ocf_discard_cache_flush_io_cmpl(struct ocf_io *io, int error) +static void _ocf_discard_cache_flush_complete(struct ocf_io *io, int error) { struct ocf_request *req = io->priv1; @@ -107,7 +107,7 @@ static int _ocf_discard_flush_cache(struct ocf_request *req) } ocf_io_configure(io, 0, 0, OCF_WRITE, 0, 0); - ocf_io_set_cmpl(io, req, NULL, _ocf_discard_cache_flush_io_cmpl); + ocf_io_set_cmpl(io, req, NULL, _ocf_discard_cache_flush_complete); ocf_dobj_submit_flush(io); @@ -128,7 +128,7 @@ static void _ocf_discard_finish_step(struct ocf_request *req) ocf_engine_push_req_front(req, true); } -static void _ocf_discard_step_io(struct ocf_request *req, int error) +static void _ocf_discard_step_complete(struct ocf_request *req, int error) { if (error) req->error |= error; @@ -170,14 +170,14 @@ int _ocf_discard_step_do(struct ocf_request *req) if (req->info.flush_metadata) { /* Request was dirty and need to flush metadata */ ocf_metadata_flush_do_asynch(cache, req, - _ocf_discard_step_io); + _ocf_discard_step_complete); } OCF_METADATA_UNLOCK_WR(); /*- END Metadata WR access ---------*/ } OCF_DEBUG_RQ(req, "Discard"); - _ocf_discard_step_io(req, 0); + _ocf_discard_step_complete(req, 0); /* Put OCF request - decrease reference counter */ ocf_req_put(req); diff --git a/src/engine/engine_fast.c b/src/engine/engine_fast.c index e3fb085..2fd350b 100644 --- a/src/engine/engine_fast.c +++ b/src/engine/engine_fast.c @@ -28,7 +28,7 @@ * |_| \_\___|\__,_|\__,_| |_| \__,_|___/\__| |_| \__,_|\__|_| |_| */ -static void _ocf_read_fast_io(struct ocf_request *req, int error) +static void _ocf_read_fast_complete(struct ocf_request *req, int error) { if (error) req->error |= error; @@ -89,7 +89,7 @@ static int _ocf_read_fast_do(struct ocf_request *req) OCF_DEBUG_RQ(req, "Submit"); env_atomic_set(&req->req_remaining, ocf_engine_io_count(req)); ocf_submit_cache_reqs(req->cache, req->map, req, OCF_READ, - ocf_engine_io_count(req), _ocf_read_fast_io); + ocf_engine_io_count(req), _ocf_read_fast_complete); /* Updata statistics */ diff --git a/src/engine/engine_ops.c b/src/engine/engine_ops.c index 8ca8687..8d98012 100644 --- a/src/engine/engine_ops.c +++ b/src/engine/engine_ops.c @@ -13,7 +13,7 @@ #define OCF_ENGINE_DEBUG_IO_NAME "ops" #include "engine_debug.h" -static void _ocf_engine_ops_io(struct ocf_request *req, int error) +static void _ocf_engine_ops_complete(struct ocf_request *req, int error) { if (error) req->error |= error; @@ -49,10 +49,10 @@ int ocf_engine_ops(struct ocf_request *req) /* Submit operation into core device */ ocf_submit_obj_req(&cache->core[req->core_id].obj, req, - _ocf_engine_ops_io); + _ocf_engine_ops_complete); ocf_submit_cache_reqs(cache, req->map, req, req->rw, - 1, _ocf_engine_ops_io); + 1, _ocf_engine_ops_complete); /* Put OCF request - decrease reference counter */ ocf_req_put(req); diff --git a/src/engine/engine_pt.c b/src/engine/engine_pt.c index 79d511d..7652662 100644 --- a/src/engine/engine_pt.c +++ b/src/engine/engine_pt.c @@ -16,7 +16,7 @@ #define OCF_ENGINE_DEBUG_IO_NAME "pt" #include "engine_debug.h" -static void _ocf_read_pt_io(struct ocf_request *req, int error) +static void _ocf_read_pt_complete(struct ocf_request *req, int error) { if (error) req->error |= error; @@ -51,7 +51,7 @@ static inline void _ocf_read_pt_submit(struct ocf_request *req) /* Core read */ ocf_submit_obj_req(&cache->core[req->core_id].obj, req, - _ocf_read_pt_io); + _ocf_read_pt_complete); } int ocf_read_pt_do(struct ocf_request *req) diff --git a/src/engine/engine_rd.c b/src/engine/engine_rd.c index d42c1bc..2384433 100644 --- a/src/engine/engine_rd.c +++ b/src/engine/engine_rd.c @@ -22,7 +22,7 @@ #define OCF_ENGINE_DEBUG_IO_NAME "rd" #include "engine_debug.h" -static void _ocf_read_generic_hit_io(struct ocf_request *req, int error) +static void _ocf_read_generic_hit_complete(struct ocf_request *req, int error) { if (error) req->error |= error; @@ -56,7 +56,7 @@ static void _ocf_read_generic_hit_io(struct ocf_request *req, int error) } } -static void _ocf_read_generic_miss_io(struct ocf_request *req, int error) +static void _ocf_read_generic_miss_complete(struct ocf_request *req, int error) { struct ocf_cache *cache = req->cache; @@ -108,7 +108,7 @@ static inline void _ocf_read_generic_submit_hit(struct ocf_request *req) env_atomic_set(&req->req_remaining, ocf_engine_io_count(req)); ocf_submit_cache_reqs(req->cache, req->map, req, OCF_READ, - ocf_engine_io_count(req), _ocf_read_generic_hit_io); + ocf_engine_io_count(req), _ocf_read_generic_hit_complete); } static inline void _ocf_read_generic_submit_miss(struct ocf_request *req) @@ -129,12 +129,12 @@ static inline void _ocf_read_generic_submit_miss(struct ocf_request *req) /* Submit read request to core device. */ ocf_submit_obj_req(&cache->core[req->core_id].obj, req, - _ocf_read_generic_miss_io); + _ocf_read_generic_miss_complete); return; err_alloc: - _ocf_read_generic_miss_io(req, -ENOMEM); + _ocf_read_generic_miss_complete(req, -ENOMEM); } static int _ocf_read_generic_do(struct ocf_request *req) diff --git a/src/engine/engine_wa.c b/src/engine/engine_wa.c index 102d6c7..aa17b35 100644 --- a/src/engine/engine_wa.c +++ b/src/engine/engine_wa.c @@ -14,7 +14,7 @@ #define OCF_ENGINE_DEBUG_IO_NAME "wa" #include "engine_debug.h" -static void _ocf_read_wa_io(struct ocf_request *req, int error) +static void _ocf_read_wa_complete(struct ocf_request *req, int error) { if (error) req->error |= error; @@ -73,7 +73,7 @@ int ocf_write_wa(struct ocf_request *req) /* Submit write IO to the core */ env_atomic_set(&req->req_remaining, 1); ocf_submit_obj_req(&cache->core[req->core_id].obj, req, - _ocf_read_wa_io); + _ocf_read_wa_complete); /* Update statistics */ ocf_engine_update_block_stats(req); diff --git a/src/engine/engine_wb.c b/src/engine/engine_wb.c index c2f6323..6c4fcac 100644 --- a/src/engine/engine_wb.c +++ b/src/engine/engine_wb.c @@ -85,7 +85,7 @@ static const struct ocf_io_if _io_if_wb_flush_metadata = { .write = ocf_write_wb_do_flush_metadata, }; -static void _ocf_write_wb_io(struct ocf_request *req, int error) +static void _ocf_write_wb_complete(struct ocf_request *req, int error) { if (error) { env_atomic_inc(&req->cache->core[req->core_id].counters-> @@ -142,7 +142,7 @@ static inline void _ocf_write_wb_submit(struct ocf_request *req) /* Data IO */ ocf_submit_cache_reqs(cache, req->map, req, OCF_WRITE, - ocf_engine_io_count(req), _ocf_write_wb_io); + ocf_engine_io_count(req), _ocf_write_wb_complete); } int ocf_write_wb_do(struct ocf_request *req) diff --git a/src/engine/engine_wi.c b/src/engine/engine_wi.c index e423b32..43bb0bf 100644 --- a/src/engine/engine_wi.c +++ b/src/engine/engine_wi.c @@ -73,7 +73,7 @@ static int ocf_write_wi_update_and_flush_metadata(struct ocf_request *req) return 0; } -static void _ocf_write_wi_core_io(struct ocf_request *req, int error) +static void _ocf_write_wi_core_complete(struct ocf_request *req, int error) { if (error) { req->error = error; @@ -112,7 +112,7 @@ static int _ocf_write_wi_do(struct ocf_request *req) /* Submit write IO to the core */ ocf_submit_obj_req(&cache->core[req->core_id].obj, req, - _ocf_write_wi_core_io); + _ocf_write_wi_core_complete); /* Update statistics */ ocf_engine_update_block_stats(req); diff --git a/src/engine/engine_wt.c b/src/engine/engine_wt.c index 2e45cf0..61be844 100644 --- a/src/engine/engine_wt.c +++ b/src/engine/engine_wt.c @@ -18,7 +18,7 @@ #define OCF_ENGINE_DEBUG_IO_NAME "wt" #include "engine_debug.h" -static void _ocf_write_wt_io(struct ocf_request *req) +static void _ocf_write_wt_req_complete(struct ocf_request *req) { if (env_atomic_dec_return(&req->req_remaining)) return; @@ -44,7 +44,7 @@ static void _ocf_write_wt_io(struct ocf_request *req) } } -static void _ocf_write_wt_cache_io(struct ocf_request *req, int error) +static void _ocf_write_wt_cache_complete(struct ocf_request *req, int error) { if (error) { req->error = req->error ?: error; @@ -55,10 +55,10 @@ static void _ocf_write_wt_cache_io(struct ocf_request *req, int error) inc_fallback_pt_error_counter(req->cache); } - _ocf_write_wt_io(req); + _ocf_write_wt_req_complete(req); } -static void _ocf_write_wt_core_io(struct ocf_request *req, int error) +static void _ocf_write_wt_core_complete(struct ocf_request *req, int error) { if (error) { req->error = error; @@ -67,7 +67,7 @@ static void _ocf_write_wt_core_io(struct ocf_request *req, int error) core_errors.write); } - _ocf_write_wt_io(req); + _ocf_write_wt_req_complete(req); } static inline void _ocf_write_wt_submit(struct ocf_request *req) @@ -85,16 +85,16 @@ static inline void _ocf_write_wt_submit(struct ocf_request *req) /* Metadata flush IO */ ocf_metadata_flush_do_asynch(cache, req, - _ocf_write_wt_cache_io); + _ocf_write_wt_cache_complete); } /* To cache */ ocf_submit_cache_reqs(cache, req->map, req, OCF_WRITE, - ocf_engine_io_count(req), _ocf_write_wt_cache_io); + ocf_engine_io_count(req), _ocf_write_wt_cache_complete); /* To core */ ocf_submit_obj_req(&cache->core[req->core_id].obj, req, - _ocf_write_wt_core_io); + _ocf_write_wt_core_complete); } static void _ocf_write_wt_update_bits(struct ocf_request *req)