From 5844ac33e46839babf72edf7e8315b45cb95ebc6 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Sat, 20 Jul 2002 20:47:53 -0700 Subject: [PATCH] block device size cleanups 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). --- include/linux/blkdev.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'include/linux/blkdev.h') diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 297cb0ba10c1..7460a98bb0b3 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -389,20 +389,6 @@ extern inline unsigned int block_size(struct block_device *bdev) return bdev->bd_block_size; } -static inline loff_t blkdev_size_in_bytes(kdev_t dev) -{ -#if 0 - if (blk_size_in_bytes[major(dev)]) - return blk_size_in_bytes[major(dev)][minor(dev)]; - else -#endif - if (blk_size[major(dev)]) - return (loff_t) blk_size[major(dev)][minor(dev)] - << BLOCK_SIZE_BITS; - else - return 0; -} - typedef struct {struct page *v;} Sector; unsigned char *read_dev_sector(struct block_device *, unsigned long, Sector *); -- cgit v1.2.3