]> git.baikalelectronics.ru Git - kernel.git/commit
block, bdi: an active gendisk always has a request_queue associated with it
authorTejun Heo <tj@kernel.org>
Sun, 7 Sep 2014 23:03:56 +0000 (08:03 +0900)
committerJens Axboe <axboe@fb.com>
Mon, 8 Sep 2014 16:00:35 +0000 (10:00 -0600)
commitab83f88fbf9575ba404fdfe19ad8a507130a6fc0
treea865fe69407f8c15d4d877defbc801aebf8d1849
parentb8ac57a2f63879752e8ecd0fbbdcd3aa41a783bb
block, bdi: an active gendisk always has a request_queue associated with it

bdev_get_queue() returns the request_queue associated with the
specified block_device.  blk_get_backing_dev_info() makes use of
bdev_get_queue() to determine the associated bdi given a block_device.

All the callers of bdev_get_queue() including
blk_get_backing_dev_info() assume that bdev_get_queue() may return
NULL and implement NULL handling; however, bdev_get_queue() requires
the passed in block_device is opened and attached to its gendisk.
Because an active gendisk always has a valid request_queue associated
with it, bdev_get_queue() can never return NULL and neither can
blk_get_backing_dev_info().

Make it clear that neither of the two functions can return NULL and
remove NULL handling from all the callers.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Chris Mason <clm@fb.com>
Cc: Dave Chinner <david@fromorbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-core.c
block/compat_ioctl.c
block/ioctl.c
fs/block_dev.c
fs/btrfs/disk-io.c
fs/xfs/xfs_buf.c
include/linux/blkdev.h