aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/elevator.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-10-19 08:33:08 -0400
committerJens Axboe <axboe@kernel.dk>2011-10-19 08:33:08 -0400
commitbd87b5898a72b1aef6acf3705c61c9f6372adf0c (patch)
treea1954f352d16307d0846e42b2246be6b1594fb9b /include/linux/elevator.h
parentda8303c63b8de73619884382d6e573d44aae0810 (diff)
block: drop @tsk from attempt_plug_merge() and explain sync rules
attempt_plug_merge() accesses elevator without holding queue_lock and may call into ->elevator_bio_merge_fn(). The elvator is guaranteed to be valid because it's accessed iff the plugged list has requests and elevator is never exited with live requests, so as long as the elevator method can deal with unlocked access, this is safe. Explain the sync rules around attempt_plug_merge() and drop the unnecessary @tsk parameter. This patch doesn't introduce any functional change. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/elevator.h')
-rw-r--r--include/linux/elevator.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index d800d5142184..1d0f7a2ff73b 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -38,6 +38,12 @@ struct elevator_ops
38 elevator_merged_fn *elevator_merged_fn; 38 elevator_merged_fn *elevator_merged_fn;
39 elevator_merge_req_fn *elevator_merge_req_fn; 39 elevator_merge_req_fn *elevator_merge_req_fn;
40 elevator_allow_merge_fn *elevator_allow_merge_fn; 40 elevator_allow_merge_fn *elevator_allow_merge_fn;
41
42 /*
43 * Used for both plugged list and elevator merging and in the
44 * former case called without queue_lock. Read comment on top of
45 * attempt_plug_merge() for details.
46 */
41 elevator_bio_merged_fn *elevator_bio_merged_fn; 47 elevator_bio_merged_fn *elevator_bio_merged_fn;
42 48
43 elevator_dispatch_fn *elevator_dispatch_fn; 49 elevator_dispatch_fn *elevator_dispatch_fn;