diff options
author | Tejun Heo <tj@kernel.org> | 2011-12-13 18:33:38 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2011-12-13 18:33:38 -0500 |
commit | 09ac46c429464c919d04bb737b27edd84d944f02 (patch) | |
tree | 0fb3b7344ead06d08dbd77470445821817c439b7 /block/blk-core.c | |
parent | 6e736be7f282fff705db7c34a15313281b372a76 (diff) |
block: misc updates to blk_get_queue()
* blk_get_queue() is peculiar in that it returns 0 on success and 1 on
failure instead of 0 / -errno or boolean. Update it such that it
returns %true on success and %false on failure.
* Make sure the caller checks for the return value.
* Separate out __blk_get_queue() which doesn't check whether @q is
dead and put it in blk.h. This will be used later.
This patch doesn't introduce any functional changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index af7301581172..fd4749391e17 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -626,14 +626,14 @@ blk_init_allocated_queue_node(struct request_queue *q, request_fn_proc *rfn, | |||
626 | } | 626 | } |
627 | EXPORT_SYMBOL(blk_init_allocated_queue_node); | 627 | EXPORT_SYMBOL(blk_init_allocated_queue_node); |
628 | 628 | ||
629 | int blk_get_queue(struct request_queue *q) | 629 | bool blk_get_queue(struct request_queue *q) |
630 | { | 630 | { |
631 | if (likely(!blk_queue_dead(q))) { | 631 | if (likely(!blk_queue_dead(q))) { |
632 | kobject_get(&q->kobj); | 632 | __blk_get_queue(q); |
633 | return 0; | 633 | return true; |
634 | } | 634 | } |
635 | 635 | ||
636 | return 1; | 636 | return false; |
637 | } | 637 | } |
638 | EXPORT_SYMBOL(blk_get_queue); | 638 | EXPORT_SYMBOL(blk_get_queue); |
639 | 639 | ||