-
- Downloads
block: simplify bdev/disk lookup in blkdev_get
To simplify block device lookup and a few other upcoming areas, make sure that we always have a struct block_device available for each disk and each partition, and only find existing block devices in bdget. The only downside of this is that each device and partition uses a little more memory. The upside will be that a lot of code can be simplified. With that all we need to look up the block device is to lookup the inode and do a few sanity checks on the gendisk, instead of the separate lookup for the gendisk. For blk-cgroup which wants to access a gendisk without opening it, a new blkdev_{get,put}_no_open low-level interface is added to replace the previous get_gendisk use. Note that the change to look up block device directly instead of the two step lookup using struct gendisk causes a subtile change in behavior: accessing a non-existing partition on an existing block device can now cause a call to request_module. That call is harmless, and in practice no recent system will access these nodes as they aren't created by udev and static /dev/ setups are unusual. Signed-off-by:Christoph Hellwig <hch@lst.de> Reviewed-by:
Jan Kara <jack@suse.cz> Reviewed-by:
Hannes Reinecke <hare@suse.de> Signed-off-by:
Jens Axboe <axboe@kernel.dk>
Showing
- block/blk-cgroup.c 21 additions, 21 deletionsblock/blk-cgroup.c
- block/blk-iocost.c 18 additions, 18 deletionsblock/blk-iocost.c
- block/blk.h 1 addition, 1 deletionblock/blk.h
- block/genhd.c 24 additions, 186 deletionsblock/genhd.c
- block/partitions/core.c 17 additions, 12 deletionsblock/partitions/core.c
- fs/block_dev.c 101 additions, 76 deletionsfs/block_dev.c
- include/linux/blk-cgroup.h 2 additions, 2 deletionsinclude/linux/blk-cgroup.h
- include/linux/blkdev.h 6 additions, 0 deletionsinclude/linux/blkdev.h
- include/linux/genhd.h 4 additions, 3 deletionsinclude/linux/genhd.h
Loading
Please register or sign in to comment