Modify engines to use forward API
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com> Signed-off-by: Rafal Stefanowski <rafal.stefanowski@huawei.com> Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:

committed by
Michal Mielewczyk

parent
e667c10b4a
commit
1ed707361f
@@ -8,9 +8,9 @@
|
||||
#include "engine_pt.h"
|
||||
#include "engine_rd.h"
|
||||
#include "engine_common.h"
|
||||
#include "engine_io.h"
|
||||
#include "cache_engine.h"
|
||||
#include "../ocf_request.h"
|
||||
#include "../utils/utils_io.h"
|
||||
#include "../utils/utils_user_part.h"
|
||||
#include "../metadata/metadata.h"
|
||||
#include "../concurrency/ocf_concurrency.h"
|
||||
@@ -20,19 +20,13 @@
|
||||
|
||||
static void _ocf_read_pt_complete(struct ocf_request *req, int error)
|
||||
{
|
||||
if (error)
|
||||
req->error |= error;
|
||||
|
||||
if (env_atomic_dec_return(&req->req_remaining))
|
||||
return;
|
||||
|
||||
OCF_DEBUG_RQ(req, "Completion");
|
||||
|
||||
if (req->error)
|
||||
if (error)
|
||||
ocf_core_stats_core_error_update(req->core, OCF_READ);
|
||||
|
||||
/* Complete request */
|
||||
req->complete(req, req->error);
|
||||
req->complete(req, error);
|
||||
|
||||
ocf_req_unlock(ocf_cache_line_concurrency(req->cache), req);
|
||||
|
||||
@@ -42,12 +36,10 @@ static void _ocf_read_pt_complete(struct ocf_request *req, int error)
|
||||
|
||||
static inline void _ocf_read_pt_submit(struct ocf_request *req)
|
||||
{
|
||||
env_atomic_set(&req->req_remaining, 1); /* Core device IO */
|
||||
|
||||
OCF_DEBUG_RQ(req, "Submit");
|
||||
|
||||
/* Core read */
|
||||
ocf_submit_volume_req(&req->core->volume, req, _ocf_read_pt_complete);
|
||||
ocf_engine_forward_core_io_req(req, _ocf_read_pt_complete);
|
||||
}
|
||||
|
||||
int ocf_read_pt_do(struct ocf_request *req)
|
||||
|
Reference in New Issue
Block a user