Added a priority queue for the request instead of push front
Now the request can be pushed to a high priority queue (instead of ocf_queue_push_req_front) and to a low priority queue (instead of ocf_queue_push_req_back). Both functions were merged into one function (ocf_queue_push_req) and instead of the allow_sync parameter there is now a flags parameter that can be an OR combination of OCF_QUEUE_ALLOW_SYNC and OCF_QUEUE_PRIO_HIGH Signed-off-by: Ian Levine <ian.levine@huawei.com> Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:

committed by
Robert Baldyga

parent
4f2d5c22d6
commit
ac1b6b774a
@@ -56,8 +56,8 @@ static void _ocf_write_wi_io_flush_metadata(struct ocf_request *req, int error)
|
||||
|
||||
if (!req->error && !req->wi_second_pass && ocf_engine_is_miss(req)) {
|
||||
/* need another pass */
|
||||
ocf_queue_push_req_front_cb(req, _ocf_write_wi_next_pass,
|
||||
true);
|
||||
ocf_queue_push_req_cb(req, _ocf_write_wi_next_pass,
|
||||
OCF_QUEUE_ALLOW_SYNC | OCF_QUEUE_PRIO_HIGH);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -123,8 +123,9 @@ static void _ocf_write_wi_core_complete(struct ocf_request *req, int error)
|
||||
|
||||
ocf_req_put(req);
|
||||
} else {
|
||||
ocf_queue_push_req_front_cb(req,
|
||||
ocf_write_wi_update_and_flush_metadata, true);
|
||||
ocf_queue_push_req_cb(req,
|
||||
ocf_write_wi_update_and_flush_metadata,
|
||||
OCF_QUEUE_ALLOW_SYNC | OCF_QUEUE_PRIO_HIGH);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +156,7 @@ static int _ocf_write_wi_core_write(struct ocf_request *req)
|
||||
static void _ocf_write_wi_on_resume(struct ocf_request *req)
|
||||
{
|
||||
OCF_DEBUG_RQ(req, "On resume");
|
||||
ocf_queue_push_req_front(req, true);
|
||||
ocf_queue_push_req(req, OCF_QUEUE_ALLOW_SYNC | OCF_QUEUE_PRIO_HIGH);
|
||||
}
|
||||
|
||||
int ocf_write_wi(struct ocf_request *req)
|
||||
|
Reference in New Issue
Block a user