Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
cad97516
Commit
cad97516
authored
Jan 14, 2007
by
Jens Axboe
Committed by
Jens Axboe
Feb 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
elevator: abstract out the activate and deactivate functions
Signed-off-by:
Jens Axboe
<
jens.axboe@oracle.com
>
parent
958b7f37
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
block/elevator.c
block/elevator.c
+20
-9
No files found.
block/elevator.c
View file @
cad97516
...
...
@@ -269,6 +269,22 @@ void elevator_exit(elevator_t *e)
EXPORT_SYMBOL
(
elevator_exit
);
static
void
elv_activate_rq
(
request_queue_t
*
q
,
struct
request
*
rq
)
{
elevator_t
*
e
=
q
->
elevator
;
if
(
e
->
ops
->
elevator_activate_req_fn
)
e
->
ops
->
elevator_activate_req_fn
(
q
,
rq
);
}
static
void
elv_deactivate_rq
(
request_queue_t
*
q
,
struct
request
*
rq
)
{
elevator_t
*
e
=
q
->
elevator
;
if
(
e
->
ops
->
elevator_deactivate_req_fn
)
e
->
ops
->
elevator_deactivate_req_fn
(
q
,
rq
);
}
static
inline
void
__elv_rqhash_del
(
struct
request
*
rq
)
{
hlist_del_init
(
&
rq
->
hash
);
...
...
@@ -498,16 +514,14 @@ void elv_merge_requests(request_queue_t *q, struct request *rq,
void
elv_requeue_request
(
request_queue_t
*
q
,
struct
request
*
rq
)
{
elevator_t
*
e
=
q
->
elevator
;
/*
* it already went through dequeue, we need to decrement the
* in_flight count again
*/
if
(
blk_account_rq
(
rq
))
{
q
->
in_flight
--
;
if
(
blk_sorted_rq
(
rq
)
&&
e
->
ops
->
elevator_deactivate_req_fn
)
e
->
ops
->
elevator_deactivate_req_fn
(
q
,
rq
);
if
(
blk_sorted_rq
(
rq
))
e
lv_deactivate_rq
(
q
,
rq
);
}
rq
->
cmd_flags
&=
~
REQ_STARTED
;
...
...
@@ -700,16 +714,13 @@ struct request *elv_next_request(request_queue_t *q)
while
((
rq
=
__elv_next_request
(
q
))
!=
NULL
)
{
if
(
!
(
rq
->
cmd_flags
&
REQ_STARTED
))
{
elevator_t
*
e
=
q
->
elevator
;
/*
* This is the first time the device driver
* sees this request (possibly after
* requeueing). Notify IO scheduler.
*/
if
(
blk_sorted_rq
(
rq
)
&&
e
->
ops
->
elevator_activate_req_fn
)
e
->
ops
->
elevator_activate_req_fn
(
q
,
rq
);
if
(
blk_sorted_rq
(
rq
))
elv_activate_rq
(
q
,
rq
);
/*
* just mark as started even if we don't start
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment