1
0
Fork 0

[PATCH] Avoid unnecessary ide-cd cache flushes

Only issue a cdrom cache flush if we've done write to the drive.  The
->media_written() flag keeps track of that.

Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
hifive-unleashed-5.1
Jens Axboe 2005-05-01 12:12:52 -07:00 committed by Linus Torvalds
parent 76530da1a9
commit 7da21a02b3
1 changed files with 1 additions and 1 deletions

View File

@ -645,7 +645,7 @@ static int cdrom_mrw_exit(struct cdrom_device_info *cdi)
ret = cdrom_mrw_bgformat_susp(cdi, 0);
}
if (!ret)
if (!ret && cdi->media_written)
ret = cdrom_flush_cache(cdi);
return ret;