aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-gd.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 12:09:12 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 12:09:12 -0400
commitcedd120cac61fa149ba215eabc57b2578068be00 (patch)
tree40d591ee849a79256ab6d14c2807dd630f6c5520 /drivers/ide/ide-gd.c
parent5fef0e5c0283949f95a7891c9424a9f84448116b (diff)
ide-disk: use IDE_DFLAG_MEDIA_CHANGED
Set IDE_DFLAG_MEDIA_CHANGED in ide_gd_open() to signalize ide_gd_media_changed() that that media has changed (instead of relying on IDE_DFLAG_REMOVABLE). There should be no functional changes caused by this patch. Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-gd.c')
-rw-r--r--drivers/ide/ide-gd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c
index 84bbcfee9233..c08500270b9d 100644
--- a/drivers/ide/ide-gd.c
+++ b/drivers/ide/ide-gd.c
@@ -160,6 +160,7 @@ static int ide_gd_open(struct inode *inode, struct file *filp)
160 * and the door_lock is irrelevant at this point. 160 * and the door_lock is irrelevant at this point.
161 */ 161 */
162 ide_disk_set_doorlock(drive, 1); 162 ide_disk_set_doorlock(drive, 1);
163 drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
163 check_disk_change(inode->i_bdev); 164 check_disk_change(inode->i_bdev);
164 } 165 }
165 return 0; 166 return 0;
@@ -199,6 +200,7 @@ static int ide_gd_media_changed(struct gendisk *disk)
199{ 200{
200 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); 201 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
201 ide_drive_t *drive = idkp->drive; 202 ide_drive_t *drive = idkp->drive;
203 int ret;
202 204
203 /* do not scan partitions twice if this is a removable device */ 205 /* do not scan partitions twice if this is a removable device */
204 if (drive->dev_flags & IDE_DFLAG_ATTACH) { 206 if (drive->dev_flags & IDE_DFLAG_ATTACH) {
@@ -206,8 +208,10 @@ static int ide_gd_media_changed(struct gendisk *disk)
206 return 0; 208 return 0;
207 } 209 }
208 210
209 /* if removable, always assume it was changed */ 211 ret = !!(drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED);
210 return !!(drive->dev_flags & IDE_DFLAG_REMOVABLE); 212 drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED;
213
214 return ret;
211} 215}
212 216
213static int ide_gd_revalidate_disk(struct gendisk *disk) 217static int ide_gd_revalidate_disk(struct gendisk *disk)