Skip to content

Commit

Permalink
Rename engine_ops to engine_flush
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
  • Loading branch information
robertbaldyga authored and mmichal10 committed Sep 10, 2024
1 parent fa8c28c commit 7c3e333
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
14 changes: 7 additions & 7 deletions src/engine/cache_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include "engine_wb.h"
#include "engine_wo.h"
#include "engine_fast.h"
#include "engine_flush.h"
#include "engine_discard.h"
#include "engine_d2c.h"
#include "engine_ops.h"
#include "../utils/utils_user_part.h"
#include "../utils/utils_refcnt.h"
#include "../ocf_request.h"
Expand All @@ -40,9 +40,9 @@ enum ocf_io_if_type {

/* Private OCF interfaces */
OCF_IO_FAST_IF,
OCF_IO_FLUSH_IF,
OCF_IO_DISCARD_IF,
OCF_IO_D2C_IF,
OCF_IO_OPS_IF,
OCF_IO_PRIV_MAX_IF,
};

Expand Down Expand Up @@ -110,10 +110,10 @@ static const struct ocf_io_if IO_IFS[OCF_IO_PRIV_MAX_IF] = {
},
.name = "Direct to core",
},
[OCF_IO_OPS_IF] = {
[OCF_IO_FLUSH_IF] = {
.cbs = {
[OCF_READ] = ocf_engine_ops,
[OCF_WRITE] = ocf_engine_ops,
[OCF_READ] = ocf_engine_flush,
[OCF_WRITE] = ocf_engine_flush,
},
.name = "Ops engine",
},
Expand Down Expand Up @@ -274,13 +274,13 @@ void ocf_engine_hndl_discard_req(struct ocf_request *req)
IO_IFS[OCF_IO_DISCARD_IF].cbs[req->rw](req);
}

void ocf_engine_hndl_ops_req(struct ocf_request *req)
void ocf_engine_hndl_flush_req(struct ocf_request *req)
{
ocf_req_get(req);

req->engine_handler = (req->d2c) ?
ocf_io_if_type_to_engine_cb(OCF_IO_D2C_IF, req->rw) :
ocf_io_if_type_to_engine_cb(OCF_IO_OPS_IF, req->rw);
ocf_io_if_type_to_engine_cb(OCF_IO_FLUSH_IF, req->rw);

ocf_queue_push_req(req, OCF_QUEUE_ALLOW_SYNC);
}
Expand Down
4 changes: 2 additions & 2 deletions src/engine/cache_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ int ocf_engine_hndl_req(struct ocf_request *req);

int ocf_engine_hndl_fast_req(struct ocf_request *req);

void ocf_engine_hndl_discard_req(struct ocf_request *req);
void ocf_engine_hndl_flush_req(struct ocf_request *req);

void ocf_engine_hndl_ops_req(struct ocf_request *req);
void ocf_engine_hndl_discard_req(struct ocf_request *req);

#endif
12 changes: 6 additions & 6 deletions src/engine/engine_ops.c → src/engine/engine_flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
#include "../ocf_cache_priv.h"
#include "engine_common.h"
#include "cache_engine.h"
#include "engine_ops.h"
#include "engine_flush.h"
#include "../ocf_request.h"
#include "../utils/utils_io.h"

#define OCF_ENGINE_DEBUG_IO_NAME "ops"
#define OCF_ENGINE_DEBUG_IO_NAME "flush"
#include "engine_debug.h"

static void _ocf_engine_ops_complete(struct ocf_request *req, int error)
static void _ocf_engine_flush_complete(struct ocf_request *req, int error)
{
if (error)
req->error |= error;
Expand All @@ -35,7 +35,7 @@ static void _ocf_engine_ops_complete(struct ocf_request *req, int error)
ocf_req_put(req);
}

int ocf_engine_ops(struct ocf_request *req)
int ocf_engine_flush(struct ocf_request *req)
{
/* Get OCF request - increase reference counter */
ocf_req_get(req);
Expand All @@ -45,11 +45,11 @@ int ocf_engine_ops(struct ocf_request *req)

/* Submit operation into core device */
ocf_submit_volume_req(&req->core->volume, req,
_ocf_engine_ops_complete);
_ocf_engine_flush_complete);


/* submit flush to cache device */
ocf_submit_cache_flush(req, _ocf_engine_ops_complete);
ocf_submit_cache_flush(req, _ocf_engine_flush_complete);

/* Put OCF request - decrease reference counter */
ocf_req_put(req);
Expand Down
11 changes: 11 additions & 0 deletions src/engine/engine_flush.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/

#ifndef __CACHE_ENGINE_FLUSH_H_
#define __CACHE_ENGINE_FLUSH_H_

int ocf_engine_flush(struct ocf_request *req);

#endif /* __CACHE_ENGINE_FLUSH_H_ */
11 changes: 0 additions & 11 deletions src/engine/engine_ops.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/ocf_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ static void ocf_core_volume_submit_flush(struct ocf_io *io)

ocf_io_get(io);

ocf_engine_hndl_ops_req(req);
ocf_engine_hndl_flush_req(req);
}

static void ocf_core_volume_submit_discard(struct ocf_io *io)
Expand Down

0 comments on commit 7c3e333

Please sign in to comment.