Merge pull request #819 from mmichal10/rename-ops
Rename engine_ops to engine_flush
This commit is contained in:
commit
070b16b31f
@ -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"
|
||||
@ -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,
|
||||
};
|
||||
|
||||
@ -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",
|
||||
},
|
||||
@ -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);
|
||||
}
|
||||
|
@ -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_flush_req(struct ocf_request *req);
|
||||
|
||||
void ocf_engine_hndl_discard_req(struct ocf_request *req);
|
||||
|
||||
void ocf_engine_hndl_ops_req(struct ocf_request *req);
|
||||
|
||||
#endif
|
||||
|
@ -1,19 +1,20 @@
|
||||
/*
|
||||
* Copyright(c) 2012-2022 Intel Corporation
|
||||
* Copyright(c) 2024 Huawei Technologies
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
#include "ocf/ocf.h"
|
||||
#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;
|
||||
@ -35,7 +36,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);
|
||||
@ -45,11 +46,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);
|
12
src/engine/engine_flush.h
Normal file
12
src/engine/engine_flush.h
Normal file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright(c) 2012-2021 Intel Corporation
|
||||
* Copyright(c) 2024 Huawei Technologies
|
||||
* 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_ */
|
@ -1,11 +0,0 @@
|
||||
/*
|
||||
* Copyright(c) 2012-2021 Intel Corporation
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef __CACHE_ENGINE_OPS_H_
|
||||
#define __CACHE_ENGINE_OPS_H_
|
||||
|
||||
int ocf_engine_ops(struct ocf_request *req);
|
||||
|
||||
#endif /* __CACHE_ENGINE_OPS_H_ */
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user