From: viro@www.linux.org.uk Now that floppy_open() stores bdev in opened_bdevs[drive], we can remove crap from floppy_read_block_0() and have it use that bdev instead of messing with bdget_disk()/setting ->bd_disk by hand/bdput(). drivers/block/floppy.c | 18 +----------------- drivers/block/floppy98.c | 18 +----------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff -puN drivers/block/floppy98.c~large-dev_t-08 drivers/block/floppy98.c --- 25/drivers/block/floppy98.c~large-dev_t-08 2003-08-26 18:28:55.000000000 -0700 +++ 25-akpm/drivers/block/floppy98.c 2003-08-26 18:28:55.000000000 -0700 @@ -3989,22 +3989,6 @@ static int __floppy_read_block_0(struct return 0; } -static int floppy_read_block_0(struct gendisk *disk) -{ - struct block_device *bdev; - int ret; - - bdev = bdget_disk(disk, 0); - if (!bdev) { - printk("No block device for %s\n", disk->disk_name); - BUG(); - } - bdev->bd_disk = disk; /* ewww */ - ret = __floppy_read_block_0(bdev); - atomic_dec(&bdev->bd_count); - return ret; -} - /* revalidate the floppy disk, i.e. trigger format autodetection by reading * the bootblock (block 0). "Autodetection" is also needed to check whether * there is a disk in the drive at all... Thus we also do it for fixed @@ -4040,7 +4024,7 @@ static int floppy_revalidate(struct gend UDRS->generation++; if (NO_GEOM){ /* auto-sensing */ - res = floppy_read_block_0(disk); + res = __floppy_read_block_0(opened_bdev[drive]); } else { if (cf) poll_drive(0, FD_RAW_NEED_DISK); diff -puN drivers/block/floppy.c~large-dev_t-08 drivers/block/floppy.c --- 25/drivers/block/floppy.c~large-dev_t-08 2003-08-26 18:28:55.000000000 -0700 +++ 25-akpm/drivers/block/floppy.c 2003-08-26 18:28:55.000000000 -0700 @@ -3910,22 +3910,6 @@ static int __floppy_read_block_0(struct return 0; } -static int floppy_read_block_0(struct gendisk *disk) -{ - struct block_device *bdev; - int ret; - - bdev = bdget_disk(disk, 0); - if (!bdev) { - printk("No block device for %s\n", disk->disk_name); - BUG(); - } - bdev->bd_disk = disk; /* ewww */ - ret = __floppy_read_block_0(bdev); - atomic_dec(&bdev->bd_count); - return ret; -} - /* revalidate the floppy disk, i.e. trigger format autodetection by reading * the bootblock (block 0). "Autodetection" is also needed to check whether * there is a disk in the drive at all... Thus we also do it for fixed @@ -3961,7 +3945,7 @@ static int floppy_revalidate(struct gend UDRS->generation++; if (NO_GEOM){ /* auto-sensing */ - res = floppy_read_block_0(disk); + res = __floppy_read_block_0(opened_bdev[drive]); } else { if (cf) poll_drive(0, FD_RAW_NEED_DISK); _