Skip to content

Commit

Permalink
[PATCH] Avoid unnecessary ide-cd cache flushes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe authored and Linus Torvalds committed May 1, 2005
1 parent 76530da commit 7da21a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7da21a0

Please sign in to comment.