aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-10-19 14:33:01 +0200
committerZiyan <jaraidaniel@gmail.com>2016-01-08 10:36:37 +0100
commit67d87da49df6ab8b770d515ad7ba12c7cedbaf53 (patch)
tree72a395e91b0e83d96babd6e10589288995e0795b /block/blk-core.c
parent38b26ea9598761f8892cbb04f097ee65281cb559 (diff)
downloadkernel_samsung_tuna-67d87da49df6ab8b770d515ad7ba12c7cedbaf53.zip
kernel_samsung_tuna-67d87da49df6ab8b770d515ad7ba12c7cedbaf53.tar.gz
kernel_samsung_tuna-67d87da49df6ab8b770d515ad7ba12c7cedbaf53.tar.bz2
block: reorganize throtl_get_tg() and blk_throtl_bio()
blk_throtl_bio() and throtl_get_tg() have rather unusual interface. * throtl_get_tg() returns pointer to a valid tg or ERR_PTR(-ENODEV), and drops queue_lock in the latter case. Different locking context depending on return value is error-prone and DEAD state is scheduled to be protected by queue_lock anyway. Move DEAD check inside queue_lock and return valid tg or NULL. * blk_throtl_bio() indicates return status both with its return value and in/out param **@bio. The former is used to indicate whether queue is found to be dead during throtl processing. The latter whether the bio is throttled. There's no point in returning DEAD check result from blk_throtl_bio(). The queue can die after blk_throtl_bio() is finished but before make_request_fn() grabs queue lock. Make it take *@bio instead and return boolean result indicating whether the request is throttled or not. This patch doesn't cause any visible functional difference. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 694a520..d2bca83 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1460,12 +1460,8 @@ generic_make_request_checks(struct bio *bio)
goto end_io;
}
- if (blk_throtl_bio(q, &bio))
- goto end_io;
-
- /* if bio = NULL, bio has been throttled and will be submitted later. */
- if (!bio)
- return false;
+ if (blk_throtl_bio(q, bio))
+ return false; /* throttled, will be resubmitted later */
trace_block_bio_queue(q, bio);
return true;