From: Jens Axboe Date: Sun, 1 May 2005 19:12:52 +0000 (-0700) Subject: [PATCH] Avoid unnecessary ide-cd cache flushes X-Git-Tag: v2.6.12-rc4~136^2~12 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7da21a02b3587157bd43910ea6d4c76661228ebb;p=linux-2.6 [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 --- diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 9deca49c71..beaa561f2e 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;