aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-12-14 00:33:38 +0100
committerJens Axboe <axboe@kernel.dk>2011-12-14 00:33:38 +0100
commit09ac46c429464c919d04bb737b27edd84d944f02 (patch)
tree0fb3b7344ead06d08dbd77470445821817c439b7 /block/blk.h
parentblock: make ioc get/put interface more conventional and fix race on alloction (diff)
downloadlinux-dev-09ac46c429464c919d04bb737b27edd84d944f02.tar.xz
linux-dev-09ac46c429464c919d04bb737b27edd84d944f02.zip
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.h')
-rw-r--r--block/blk.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/blk.h b/block/blk.h
index fc3c41b2fd24..8d421156fefb 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -13,6 +13,11 @@ extern struct kmem_cache *blk_requestq_cachep;
extern struct kobj_type blk_queue_ktype;
extern struct ida blk_queue_ida;
+static inline void __blk_get_queue(struct request_queue *q)
+{
+ kobject_get(&q->kobj);
+}
+
void init_request_from_bio(struct request *req, struct bio *bio);
void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
struct bio *bio);