From patchwork Tue Apr 12 18:36:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 8814351 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3F9B1C0554 for ; Tue, 12 Apr 2016 18:36:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 659252021F for ; Tue, 12 Apr 2016 18:36:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8AC86201C8 for ; Tue, 12 Apr 2016 18:36:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934280AbcDLSgk (ORCPT ); Tue, 12 Apr 2016 14:36:40 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:23885 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934184AbcDLSgj (ORCPT ); Tue, 12 Apr 2016 14:36:39 -0400 Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.16.0.11/8.16.0.11) with SMTP id u3CIYLr4005679; Tue, 12 Apr 2016 11:36:36 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=BX+LsaamhXo6idQ6NczB5bermIuR4Rl1D1lMixR4HpA=; b=GmtPfeTKQxd4LOCnRc/WlYhrytYq5crzl+JwIgL8UFiwJHRR6SDPQEt4uxeLhx3FKeIZ 9F80ya92dLCMhmJWnv0zH2h7pFebTUNdnPhhb5baq/GZ2kesryxE8mzOVXRV0Ga46qD2 Uhq+nba/Jaq4tb8BoSVqBeKqsff/z/lBSss= Received: from mail.thefacebook.com ([199.201.64.23]) by m0001303.ppops.net with ESMTP id 226wda741n-9 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT); Tue, 12 Apr 2016 11:36:36 -0700 Received: from localhost.localdomain (192.168.54.13) by mail.thefacebook.com (192.168.16.19) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 12 Apr 2016 11:36:25 -0700 From: Jens Axboe To: CC: , Jens Axboe Subject: [PATCH 13/20] dm: switch to using blk_queue_write_cache() Date: Tue, 12 Apr 2016 12:36:08 -0600 Message-ID: <1460486175-25724-14-git-send-email-axboe@fb.com> X-Mailer: git-send-email 2.8.0.rc4.6.g7e4ba36 In-Reply-To: <1460486175-25724-1-git-send-email-axboe@fb.com> References: <1460486175-25724-1-git-send-email-axboe@fb.com> MIME-Version: 1.0 X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-04-12_09:, , signatures=0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jens Axboe --- drivers/md/dm-table.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index f9e8f0bef332..4b1ffc0abe11 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -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, struct queue_limits *limits) { - unsigned flush = 0; + bool wc = false, fua = false; /* * 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, queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q); if (dm_table_supports_flush(t, REQ_FLUSH)) { - flush |= REQ_FLUSH; + wc = true; 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)) q->limits.discard_zeroes_data = 0;