• Alexander Viro's avatar
    [PATCH] block device size cleanups · 5844ac33
    Alexander Viro authored
    for partitioned devices we use ->nr_sect to find the size; blk_size[] is
    still used for things like floppy.c, etc.; that will go away later.
    
    There was only one place (do_open()) that needed it - the rest uses
    ->bd_inode->i_size now.  So blkdev_size_in_bytes() is gone - it's
    expanded in its only caller.  Same place (do_open()) finds the partition
    offset and stores it in new field ->bd_offset.  As the result, call of
    get_gendisk() is gone from the IO path - in blk_partition_remap() we
    just add ->bd_offset.
    
    Additionally, we take driver probing (get_blkfops()) outside of ->bd_sem
    (again, do_open()) - that will allow to kill ad-hackery in check_partitions()
    (opening bdev by hand).
    5844ac33
ll_rw_blk.c 52.8 KB