提交 519a7e16 编写于 作者: J Jens Axboe

dm: switch to using blk_queue_write_cache()

Signed-off-by: NJens Axboe <axboe@fb.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
上级 84b4ff9e
...@@ -1506,7 +1506,7 @@ static bool dm_table_supports_discards(struct dm_table *t) ...@@ -1506,7 +1506,7 @@ static bool dm_table_supports_discards(struct dm_table *t)
void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
struct queue_limits *limits) struct queue_limits *limits)
{ {
unsigned flush = 0; bool wc = false, fua = false;
/* /*
* Copy table's limits to the DM device's request_queue * Copy table's limits to the DM device's request_queue
...@@ -1519,11 +1519,11 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, ...@@ -1519,11 +1519,11 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
if (dm_table_supports_flush(t, REQ_FLUSH)) { if (dm_table_supports_flush(t, REQ_FLUSH)) {
flush |= REQ_FLUSH; wc = true;
if (dm_table_supports_flush(t, REQ_FUA)) if (dm_table_supports_flush(t, REQ_FUA))
flush |= REQ_FUA; fua = true;
} }
blk_queue_flush(q, flush); blk_queue_write_cache(q, wc, fua);
if (!dm_table_discard_zeroes_data(t)) if (!dm_table_discard_zeroes_data(t))
q->limits.discard_zeroes_data = 0; q->limits.discard_zeroes_data = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册