From 7da21a02b3587157bd43910ea6d4c76661228ebb Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sun, 1 May 2005 12:12:52 -0700 Subject: [PATCH] [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 Signed-off-by: Linus Torvalds --- drivers/cdrom/cdrom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 9deca49c71f..beaa561f2ed 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -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; -- 2.20.1