linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] SCSI/SD: clearer output of disk cache state
@ 2006-11-04 19:54 Luben Tuikov
  2006-11-04 20:13 ` Christoph Hellwig
  2006-11-04 23:12 ` James Bottomley
  0 siblings, 2 replies; 9+ messages in thread
From: Luben Tuikov @ 2006-11-04 19:54 UTC (permalink / raw)
  To: linux-scsi

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 drivers/scsi/sd.c |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

This patch is 8 months old.

     Luben

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 9d98723..f157747 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1354,11 +1354,6 @@ sd_read_cache_type(struct scsi_disk *sdk
 	res = sd_do_mode_sense(sdp, dbd, modepage, buffer, len, &data, &sshdr);
 
 	if (scsi_status_is_good(res)) {
-		const char *types[] = {
-			"write through", "none", "write back",
-			"write back, no read (daft)"
-		};
-		int ct = 0;
 		int offset = data.header_length + data.block_descriptor_length;
 
 		if (offset >= SD_BUF_SIZE - 2) {
@@ -1387,11 +1382,13 @@ sd_read_cache_type(struct scsi_disk *sdk
 			sdkp->DPOFUA = 0;
 		}
 
-		ct =  sdkp->RCD + 2*sdkp->WCE;
-
-		printk(KERN_NOTICE "SCSI device %s: drive cache: %s%s\n",
-		       diskname, types[ct],
-		       sdkp->DPOFUA ? " w/ FUA" : "");
+		printk(KERN_NOTICE "SCSI device %s: "
+		       "write cache: %s, read cache: %s, %s\n",
+		       diskname,
+		       sdkp->WCE ? "enabled" : "disabled",
+		       sdkp->RCD ? "disabled" : "enabled",
+		       sdkp->DPOFUA ? "supports DPO and FUA"
+		       : "doesn't support DPO or FUA");
 
 		return;
 	}
-- 
1.4.3.3.g8478



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-11-15 20:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-04 19:54 [PATCH] SCSI/SD: clearer output of disk cache state Luben Tuikov
2006-11-04 20:13 ` Christoph Hellwig
2006-11-04 23:12 ` James Bottomley
2006-11-05  0:45   ` Luben Tuikov
2006-11-05  3:57     ` Jeff Garzik
2006-11-05  5:36     ` James Bottomley
2006-11-05 14:47     ` Douglas Gilbert
2006-11-15 20:26     ` James Bottomley
2006-11-15 20:47       ` Luben Tuikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).