From: Jens Axboe <axboe@fb.com>
To: <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
<linux-block@vger.kernel.org>
Cc: Jens Axboe <axboe@fb.com>
Subject: [PATCH 4/6] sd: inform block layer of write cache state
Date: Tue, 22 Mar 2016 11:55:18 -0600 [thread overview]
Message-ID: <1458669320-6819-5-git-send-email-axboe@fb.com> (raw)
In-Reply-To: <1458669320-6819-1-git-send-email-axboe@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
---
drivers/scsi/sd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 5a5457ac9cdb..049f424fb4ad 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -192,6 +192,7 @@ cache_type_store(struct device *dev, struct device_attribute *attr,
sdkp->WCE = wce;
sdkp->RCD = rcd;
sd_set_flush_flag(sdkp);
+ blk_queue_write_cache(sdp->request_queue, wce != 0);
return count;
}
@@ -2571,7 +2572,7 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer)
sdkp->DPOFUA ? "supports DPO and FUA"
: "doesn't support DPO or FUA");
- return;
+ goto done;
}
bad_sense:
@@ -2596,6 +2597,8 @@ defaults:
}
sdkp->RCD = 0;
sdkp->DPOFUA = 0;
+done:
+ blk_queue_write_cache(sdp->request_queue, sdkp->WCE != 0);
}
/*
--
2.4.1.168.g1ea28e1
next prev parent reply other threads:[~2016-03-22 17:56 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-22 17:55 [PATCHSET][RFC] Make background writeback not suck Jens Axboe
2016-03-22 17:55 ` [PATCH 1/6] block: ensure we don't truncate top bits of the request command flags Jens Axboe
2016-03-22 18:59 ` Christoph Hellwig
2016-03-22 19:01 ` Jens Axboe
2016-03-25 2:08 ` Mike Christie
2016-03-25 4:18 ` Jens Axboe
2016-03-22 17:55 ` [PATCH 2/6] writeback: wb_start_writeback() should use WB_SYNC_ALL for WB_REASON_SYNC Jens Axboe
2016-03-22 21:34 ` Dave Chinner
2016-03-22 21:40 ` Jens Axboe
2016-03-22 21:51 ` Jens Axboe
2016-03-22 22:04 ` Dave Chinner
2016-03-22 22:07 ` Jens Axboe
2016-03-22 17:55 ` [PATCH 3/6] block: add ability to flag write back caching on a device Jens Axboe
2016-03-22 18:57 ` Christoph Hellwig
2016-03-22 18:59 ` Jens Axboe
2016-03-22 17:55 ` Jens Axboe [this message]
2016-03-22 17:55 ` [PATCH 5/6] NVMe: inform block layer of write cache state Jens Axboe
2016-03-22 17:55 ` [PATCH 6/6] writeback: throttle buffered writeback Jens Axboe
2016-03-22 20:12 ` Jeff Moyer
2016-03-22 20:19 ` Jens Axboe
2016-03-22 20:27 ` Jeff Moyer
2016-03-22 21:30 ` Shaohua Li
2016-03-22 21:35 ` Jens Axboe
2016-03-22 21:51 ` [PATCHSET][RFC] Make background writeback not suck Dave Chinner
2016-03-22 22:03 ` Jens Axboe
2016-03-22 22:31 ` Dave Chinner
2016-03-22 22:57 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1458669320-6819-5-git-send-email-axboe@fb.com \
--to=axboe@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.