Commit 88c70f33 authored by Linus Torvalds's avatar Linus Torvalds

Make block device initialization initialize the request queue

pointer before the device is opened.

This should finally fix the 2.5.x floppy driver.
parent a22744b1
...@@ -619,13 +619,20 @@ static int do_open(struct block_device *bdev, struct inode *inode, struct file * ...@@ -619,13 +619,20 @@ static int do_open(struct block_device *bdev, struct inode *inode, struct file *
} }
if (bdev->bd_contains == bdev) { if (bdev->bd_contains == bdev) {
struct gendisk *g = get_gendisk(dev); struct gendisk *g = get_gendisk(dev);
if (!bdev->bd_queue) {
struct blk_dev_struct *p = blk_dev + major(dev);
bdev->bd_queue = &p->request_queue;
if (p->queue)
bdev->bd_queue = p->queue(dev);
}
if (bdev->bd_op->open) { if (bdev->bd_op->open) {
ret = bdev->bd_op->open(inode, file); ret = bdev->bd_op->open(inode, file);
if (ret) if (ret)
goto out2; goto out2;
} }
if (!bdev->bd_openers) { if (!bdev->bd_openers) {
struct blk_dev_struct *p = blk_dev + major(dev);
struct backing_dev_info *bdi; struct backing_dev_info *bdi;
sector_t sect = 0; sector_t sect = 0;
...@@ -636,10 +643,6 @@ static int do_open(struct block_device *bdev, struct inode *inode, struct file * ...@@ -636,10 +643,6 @@ static int do_open(struct block_device *bdev, struct inode *inode, struct file *
sect = p->nr_sects; sect = p->nr_sects;
} else if (blk_size[major(dev)]) } else if (blk_size[major(dev)])
sect = blk_size[major(dev)][minor(dev)] << 1; sect = blk_size[major(dev)][minor(dev)] << 1;
if (p->queue)
bdev->bd_queue = p->queue(dev);
else
bdev->bd_queue = &p->request_queue;
bd_set_size(bdev, (loff_t)sect << 9); bd_set_size(bdev, (loff_t)sect << 9);
bdi = blk_get_backing_dev_info(bdev); bdi = blk_get_backing_dev_info(bdev);
if (bdi == NULL) if (bdi == NULL)
......
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