cleaner: refactor completion function
The completion function should be the same either when it is called from the queue context or from currnet context Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
parent
736665af47
commit
d883a40dbc
@ -192,7 +192,6 @@ static int _ocf_cleaner_complete(struct ocf_request *master)
|
||||
static void _ocf_cleaner_complete_req(struct ocf_request *req)
|
||||
{
|
||||
struct ocf_request *master = NULL;
|
||||
ocf_req_end_t cmpl;
|
||||
|
||||
if (ocf_cleaner_req_type_master == req->master_io_req_type) {
|
||||
OCF_DEBUG_MSG(req->cache, "Master completion");
|
||||
@ -219,12 +218,7 @@ static void _ocf_cleaner_complete_req(struct ocf_request *req)
|
||||
ocf_queue_push_req_cb(master, _ocf_cleaner_complete,
|
||||
OCF_QUEUE_ALLOW_SYNC | OCF_QUEUE_PRIO_HIGH);
|
||||
} else {
|
||||
/* Only master contains completion function and priv */
|
||||
cmpl = master->master_io_req;
|
||||
cmpl(master->priv, master->error);
|
||||
|
||||
/* For additional get on master allocation */
|
||||
ocf_req_put(master);
|
||||
_ocf_cleaner_complete(master);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user