From patchwork Wed Jul 26 23:58:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodrigues X-Patchwork-Id: 9866049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 163D6603FA for ; Wed, 26 Jul 2017 23:59:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07B9F287D7 for ; Wed, 26 Jul 2017 23:59:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE46D287C9; Wed, 26 Jul 2017 23:59:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A603C287D7 for ; Wed, 26 Jul 2017 23:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751509AbdGZX6l (ORCPT ); Wed, 26 Jul 2017 19:58:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:46111 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751078AbdGZX6j (ORCPT ); Wed, 26 Jul 2017 19:58:39 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 60FF4AEA7; Wed, 26 Jul 2017 23:58:38 +0000 (UTC) From: Goldwyn Rodrigues To: linux-block@vger.kernel.org Cc: hch@infradead.org, jack@suse.cz, linux-raid@vger.kernel.org, dm-devel@redhat.com, Goldwyn Rodrigues Subject: [PATCH 6/9] dm: add nowait support Date: Wed, 26 Jul 2017 18:58:03 -0500 Message-Id: <20170726235806.12148-7-rgoldwyn@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170726235806.12148-1-rgoldwyn@suse.de> References: <20170726235806.12148-1-rgoldwyn@suse.de> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Goldwyn Rodrigues Add support for bio based dm devices, which exclusively sets a make_request_fn(). Request based devices are supported by default. Signed-off-by: Goldwyn Rodrigues --- drivers/md/dm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 2edbcc2d7d3f..aa9c1a5f2966 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1550,6 +1550,8 @@ static blk_qc_t dm_make_request(struct request_queue *q, struct bio *bio) if (!(bio->bi_opf & REQ_RAHEAD)) queue_io(md, bio); + else if (bio->bi_opf & REQ_NOWAIT) + bio_wouldblock_error(bio); else bio_io_error(bio); return BLK_QC_T_NONE; @@ -2066,6 +2068,7 @@ int dm_setup_md_queue(struct mapped_device *md, struct dm_table *t) case DM_TYPE_DAX_BIO_BASED: dm_init_normal_md_queue(md); blk_queue_make_request(md->queue, dm_make_request); + queue_flag_set_unlocked(QUEUE_FLAG_NOWAIT, md->queue); /* * DM handles splitting bios as needed. Free the bio_split bioset * since it won't be used (saves 1 process per bio-based DM device).