diff options
author | Pete Zaitcev <zaitcev@redhat.com> | 2006-03-02 19:36:09 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-20 17:50:00 -0500 |
commit | 4d69581929b8f8836f806bcc320b19ed886e9517 (patch) | |
tree | bc25e86dd34b8c164a62ad47d9d04b470e27b59a | |
parent | ae55717584431761b70215d3d574c13fe97093f2 (diff) |
[PATCH] USB: ub 01 remove first_open
The first_open was long overdue for removal, but I wanted to keep this
separate for other changes in case of regressions.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/block/ub.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index 3e7689494c66..26aa96eba439 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -8,7 +8,6 @@ | |||
8 | * and is not licensed separately. See file COPYING for details. | 8 | * and is not licensed separately. See file COPYING for details. |
9 | * | 9 | * |
10 | * TODO (sorted by decreasing priority) | 10 | * TODO (sorted by decreasing priority) |
11 | * -- Kill first_open (Al Viro fixed the block layer now) | ||
12 | * -- set readonly flag for CDs, set removable flag for CF readers | 11 | * -- set readonly flag for CDs, set removable flag for CF readers |
13 | * -- do inquiry and verify we got a disk and not a tape (for LUN mismatch) | 12 | * -- do inquiry and verify we got a disk and not a tape (for LUN mismatch) |
14 | * -- special case some senses, e.g. 3a/0 -> no media present, reduce retries | 13 | * -- special case some senses, e.g. 3a/0 -> no media present, reduce retries |
@@ -334,7 +333,6 @@ struct ub_lun { | |||
334 | int changed; /* Media was changed */ | 333 | int changed; /* Media was changed */ |
335 | int removable; | 334 | int removable; |
336 | int readonly; | 335 | int readonly; |
337 | int first_open; /* Kludge. See ub_bd_open. */ | ||
338 | 336 | ||
339 | struct ub_request urq; | 337 | struct ub_request urq; |
340 | 338 | ||
@@ -1849,26 +1847,6 @@ static int ub_bd_open(struct inode *inode, struct file *filp) | |||
1849 | sc->openc++; | 1847 | sc->openc++; |
1850 | spin_unlock_irqrestore(&ub_lock, flags); | 1848 | spin_unlock_irqrestore(&ub_lock, flags); |
1851 | 1849 | ||
1852 | /* | ||
1853 | * This is a workaround for a specific problem in our block layer. | ||
1854 | * In 2.6.9, register_disk duplicates the code from rescan_partitions. | ||
1855 | * However, if we do add_disk with a device which persistently reports | ||
1856 | * a changed media, add_disk calls register_disk, which does do_open, | ||
1857 | * which will call rescan_paritions for changed media. After that, | ||
1858 | * register_disk attempts to do it all again and causes double kobject | ||
1859 | * registration and a eventually an oops on module removal. | ||
1860 | * | ||
1861 | * The bottom line is, Al Viro says that we should not allow | ||
1862 | * bdev->bd_invalidated to be set when doing add_disk no matter what. | ||
1863 | */ | ||
1864 | if (lun->first_open) { | ||
1865 | lun->first_open = 0; | ||
1866 | if (lun->changed) { | ||
1867 | rc = -ENOMEDIUM; | ||
1868 | goto err_open; | ||
1869 | } | ||
1870 | } | ||
1871 | |||
1872 | if (lun->removable || lun->readonly) | 1850 | if (lun->removable || lun->readonly) |
1873 | check_disk_change(inode->i_bdev); | 1851 | check_disk_change(inode->i_bdev); |
1874 | 1852 | ||
@@ -2537,7 +2515,6 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum) | |||
2537 | 2515 | ||
2538 | lun->removable = 1; /* XXX Query this from the device */ | 2516 | lun->removable = 1; /* XXX Query this from the device */ |
2539 | lun->changed = 1; /* ub_revalidate clears only */ | 2517 | lun->changed = 1; /* ub_revalidate clears only */ |
2540 | lun->first_open = 1; | ||
2541 | ub_revalidate(sc, lun); | 2518 | ub_revalidate(sc, lun); |
2542 | 2519 | ||
2543 | rc = -ENOMEM; | 2520 | rc = -ENOMEM; |