Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116312
b: refs/heads/master
c: cedd120
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 17, 2008
1 parent a9fcf2d commit d80e6b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5fef0e5c0283949f95a7891c9424a9f84448116b
refs/heads/master: cedd120cac61fa149ba215eabc57b2578068be00
8 changes: 6 additions & 2 deletions trunk/drivers/ide/ide-gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ static int ide_gd_open(struct inode *inode, struct file *filp)
* and the door_lock is irrelevant at this point.
*/
ide_disk_set_doorlock(drive, 1);
drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
check_disk_change(inode->i_bdev);
}
return 0;
Expand Down Expand Up @@ -199,15 +200,18 @@ static int ide_gd_media_changed(struct gendisk *disk)
{
struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
ide_drive_t *drive = idkp->drive;
int ret;

/* do not scan partitions twice if this is a removable device */
if (drive->dev_flags & IDE_DFLAG_ATTACH) {
drive->dev_flags &= ~IDE_DFLAG_ATTACH;
return 0;
}

/* if removable, always assume it was changed */
return !!(drive->dev_flags & IDE_DFLAG_REMOVABLE);
ret = !!(drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED);
drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED;

return ret;
}

static int ide_gd_revalidate_disk(struct gendisk *disk)
Expand Down

0 comments on commit d80e6b8

Please sign in to comment.