Merge pull request #14 from robertbaldyga/complete-naming-cleanup

Unify completion functions naming
This commit is contained in:
Michal Rakowski 2018-12-13 09:34:03 +01:00 committed by GitHub
commit abb8dc5067
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 35 additions and 35 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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 */

View File

@ -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);

View File

@ -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)

View File

@ -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)

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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)