Commit 3dd5fcf6 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] dev_t handling cleanups (8/12)

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().
parent 109aa2e7
......@@ -3910,22 +3910,6 @@ static int __floppy_read_block_0(struct block_device *bdev)
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 gendisk *disk)
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);
......
......@@ -3989,22 +3989,6 @@ static int __floppy_read_block_0(struct block_device *bdev)
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 gendisk *disk)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment