diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-24 13:16:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-24 13:16:26 -0400 |
commit | 6c5103890057b1bb781b26b7aae38d33e4c517d8 (patch) | |
tree | e6e57961dcddcb5841acb34956e70b9dc696a880 /drivers/block/ataflop.c | |
parent | 3dab04e6978e358ad2307bca563fabd6c5d2c58b (diff) | |
parent | 9d2e157d970a73b3f270b631828e03eb452d525e (diff) |
Merge branch 'for-2.6.39/core' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.39/core' of git://git.kernel.dk/linux-2.6-block: (65 commits)
Documentation/iostats.txt: bit-size reference etc.
cfq-iosched: removing unnecessary think time checking
cfq-iosched: Don't clear queue stats when preempt.
blk-throttle: Reset group slice when limits are changed
blk-cgroup: Only give unaccounted_time under debug
cfq-iosched: Don't set active queue in preempt
block: fix non-atomic access to genhd inflight structures
block: attempt to merge with existing requests on plug flush
block: NULL dereference on error path in __blkdev_get()
cfq-iosched: Don't update group weights when on service tree
fs: assign sb->s_bdi to default_backing_dev_info if the bdi is going away
block: Require subsystems to explicitly allocate bio_set integrity mempool
jbd2: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
jbd: finish conversion from WRITE_SYNC_PLUG to WRITE_SYNC and explicit plugging
fs: make fsync_buffers_list() plug
mm: make generic_writepages() use plugging
blk-cgroup: Add unaccounted time to timeslice_used.
block: fixup plugging stubs for !CONFIG_BLOCK
block: remove obsolete comments for blkdev_issue_zeroout.
blktrace: Use rq->cmd_flags directly in blk_add_trace_rq.
...
Fix up conflicts in fs/{aio.c,super.c}
Diffstat (limited to 'drivers/block/ataflop.c')
-rw-r--r-- | drivers/block/ataflop.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index 605a67e40bbf..c871eae14120 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c | |||
@@ -1324,23 +1324,24 @@ static void finish_fdc_done( int dummy ) | |||
1324 | * due to unrecognised disk changes. | 1324 | * due to unrecognised disk changes. |
1325 | */ | 1325 | */ |
1326 | 1326 | ||
1327 | static int check_floppy_change(struct gendisk *disk) | 1327 | static unsigned int floppy_check_events(struct gendisk *disk, |
1328 | unsigned int clearing) | ||
1328 | { | 1329 | { |
1329 | struct atari_floppy_struct *p = disk->private_data; | 1330 | struct atari_floppy_struct *p = disk->private_data; |
1330 | unsigned int drive = p - unit; | 1331 | unsigned int drive = p - unit; |
1331 | if (test_bit (drive, &fake_change)) { | 1332 | if (test_bit (drive, &fake_change)) { |
1332 | /* simulated change (e.g. after formatting) */ | 1333 | /* simulated change (e.g. after formatting) */ |
1333 | return 1; | 1334 | return DISK_EVENT_MEDIA_CHANGE; |
1334 | } | 1335 | } |
1335 | if (test_bit (drive, &changed_floppies)) { | 1336 | if (test_bit (drive, &changed_floppies)) { |
1336 | /* surely changed (the WP signal changed at least once) */ | 1337 | /* surely changed (the WP signal changed at least once) */ |
1337 | return 1; | 1338 | return DISK_EVENT_MEDIA_CHANGE; |
1338 | } | 1339 | } |
1339 | if (UD.wpstat) { | 1340 | if (UD.wpstat) { |
1340 | /* WP is on -> could be changed: to be sure, buffers should be | 1341 | /* WP is on -> could be changed: to be sure, buffers should be |
1341 | * invalidated... | 1342 | * invalidated... |
1342 | */ | 1343 | */ |
1343 | return 1; | 1344 | return DISK_EVENT_MEDIA_CHANGE; |
1344 | } | 1345 | } |
1345 | 1346 | ||
1346 | return 0; | 1347 | return 0; |
@@ -1570,7 +1571,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, | |||
1570 | * or the next access will revalidate - and clear UDT :-( | 1571 | * or the next access will revalidate - and clear UDT :-( |
1571 | */ | 1572 | */ |
1572 | 1573 | ||
1573 | if (check_floppy_change(disk)) | 1574 | if (floppy_check_events(disk, 0)) |
1574 | floppy_revalidate(disk); | 1575 | floppy_revalidate(disk); |
1575 | 1576 | ||
1576 | if (UD.flags & FTD_MSG) | 1577 | if (UD.flags & FTD_MSG) |
@@ -1904,7 +1905,7 @@ static const struct block_device_operations floppy_fops = { | |||
1904 | .open = floppy_unlocked_open, | 1905 | .open = floppy_unlocked_open, |
1905 | .release = floppy_release, | 1906 | .release = floppy_release, |
1906 | .ioctl = fd_ioctl, | 1907 | .ioctl = fd_ioctl, |
1907 | .media_changed = check_floppy_change, | 1908 | .check_events = floppy_check_events, |
1908 | .revalidate_disk= floppy_revalidate, | 1909 | .revalidate_disk= floppy_revalidate, |
1909 | }; | 1910 | }; |
1910 | 1911 | ||
@@ -1963,6 +1964,7 @@ static int __init atari_floppy_init (void) | |||
1963 | unit[i].disk->first_minor = i; | 1964 | unit[i].disk->first_minor = i; |
1964 | sprintf(unit[i].disk->disk_name, "fd%d", i); | 1965 | sprintf(unit[i].disk->disk_name, "fd%d", i); |
1965 | unit[i].disk->fops = &floppy_fops; | 1966 | unit[i].disk->fops = &floppy_fops; |
1967 | unit[i].disk->events = DISK_EVENT_MEDIA_CHANGE; | ||
1966 | unit[i].disk->private_data = &unit[i]; | 1968 | unit[i].disk->private_data = &unit[i]; |
1967 | unit[i].disk->queue = blk_init_queue(do_fd_request, | 1969 | unit[i].disk->queue = blk_init_queue(do_fd_request, |
1968 | &ataflop_lock); | 1970 | &ataflop_lock); |