diff options
author | Tejun Heo <tj@kernel.org> | 2010-09-03 05:56:16 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-09-10 06:35:36 -0400 |
commit | dd831006d5be7f74c3fe7aef82380c51c3637960 (patch) | |
tree | 30a86749f0c4f7980b2982dbde8bbcfff37b08f9 /block/blk-core.c | |
parent | 9cbbdca44ae1a6f512ea1e2be11ced8bbb9d430a (diff) |
block: misc cleanups in barrier code
Make the following cleanups in preparation of barrier/flush update.
* blk_do_ordered() declaration is moved from include/linux/blkdev.h to
block/blk.h.
* blk_do_ordered() now returns pointer to struct request, with %NULL
meaning "try the next request" and ERR_PTR(-EAGAIN) "try again
later". The third case will be dropped with further changes.
* In the initialization of proxy barrier request, data direction is
already set by init_request_from_bio(). Drop unnecessary explicit
REQ_WRITE setting and move init_request_from_bio() above REQ_FUA
flag setting.
* add_request() is collapsed into __make_request().
These changes don't make any functional difference.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index f06354183b29..f8d37a8e2c55 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1037,22 +1037,6 @@ void blk_insert_request(struct request_queue *q, struct request *rq, | |||
1037 | } | 1037 | } |
1038 | EXPORT_SYMBOL(blk_insert_request); | 1038 | EXPORT_SYMBOL(blk_insert_request); |
1039 | 1039 | ||
1040 | /* | ||
1041 | * add-request adds a request to the linked list. | ||
1042 | * queue lock is held and interrupts disabled, as we muck with the | ||
1043 | * request queue list. | ||
1044 | */ | ||
1045 | static inline void add_request(struct request_queue *q, struct request *req) | ||
1046 | { | ||
1047 | drive_stat_acct(req, 1); | ||
1048 | |||
1049 | /* | ||
1050 | * elevator indicated where it wants this request to be | ||
1051 | * inserted at elevator_merge time | ||
1052 | */ | ||
1053 | __elv_add_request(q, req, ELEVATOR_INSERT_SORT, 0); | ||
1054 | } | ||
1055 | |||
1056 | static void part_round_stats_single(int cpu, struct hd_struct *part, | 1040 | static void part_round_stats_single(int cpu, struct hd_struct *part, |
1057 | unsigned long now) | 1041 | unsigned long now) |
1058 | { | 1042 | { |
@@ -1316,7 +1300,10 @@ get_rq: | |||
1316 | req->cpu = blk_cpu_to_group(smp_processor_id()); | 1300 | req->cpu = blk_cpu_to_group(smp_processor_id()); |
1317 | if (queue_should_plug(q) && elv_queue_empty(q)) | 1301 | if (queue_should_plug(q) && elv_queue_empty(q)) |
1318 | blk_plug_device(q); | 1302 | blk_plug_device(q); |
1319 | add_request(q, req); | 1303 | |
1304 | /* insert the request into the elevator */ | ||
1305 | drive_stat_acct(req, 1); | ||
1306 | __elv_add_request(q, req, ELEVATOR_INSERT_SORT, 0); | ||
1320 | out: | 1307 | out: |
1321 | if (unplug || !queue_should_plug(q)) | 1308 | if (unplug || !queue_should_plug(q)) |
1322 | __generic_unplug_device(q); | 1309 | __generic_unplug_device(q); |