From patchwork Fri Jul 21 09:26:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guoqing Jiang X-Patchwork-Id: 9856359 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 8DE91600F5 for ; Fri, 21 Jul 2017 09:18:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88CC1285AA for ; Fri, 21 Jul 2017 09:18:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CD0C286F2; Fri, 21 Jul 2017 09:18:29 +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 25D67285AA for ; Fri, 21 Jul 2017 09:18:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753388AbdGUJS1 (ORCPT ); Fri, 21 Jul 2017 05:18:27 -0400 Received: from victor.provo.novell.com ([137.65.250.26]:45456 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752411AbdGUJS1 (ORCPT ); Fri, 21 Jul 2017 05:18:27 -0400 Received: from linux-gnb7.apac.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (TLS encrypted); Fri, 21 Jul 2017 03:18:19 -0600 From: Guoqing Jiang To: linux-block@vger.kernel.org Cc: axboe@fb.com, Guoqing Jiang , Christoph Hellwig , Philipp Reisner , Lars Ellenberg , Mike Snitzer , Sagi Grimberg , Alexander Viro Subject: [PATCH] block: use bio_io_error directly Date: Fri, 21 Jul 2017 17:26:24 +0800 Message-Id: <20170721092624.7144-1-gqjiang@suse.com> X-Mailer: git-send-email 2.10.0 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 bio_io_error is capable of replacing the two lines. Cc: Christoph Hellwig Cc: Philipp Reisner Cc: Lars Ellenberg Cc: Mike Snitzer Cc: Sagi Grimberg Cc: Alexander Viro Signed-off-by: Guoqing Jiang --- drivers/block/drbd/drbd_int.h | 3 +-- drivers/md/dm-mpath.c | 3 +-- drivers/nvme/target/io-cmd.c | 3 +-- fs/block_dev.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index d17b6e6..dd21a1b 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -1630,8 +1630,7 @@ static inline void drbd_generic_make_request(struct drbd_device *device, __release(local); if (!bio->bi_bdev) { drbd_err(device, "drbd_generic_make_request: bio->bi_bdev == NULL\n"); - bio->bi_status = BLK_STS_IOERR; - bio_endio(bio); + bio_io_error(bio); return; } diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 0e8ab5b..aa6dcc4 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -623,8 +623,7 @@ static void process_queued_bios(struct work_struct *work) r = __multipath_map_bio(m, bio, get_mpio_from_bio(bio)); switch (r) { case DM_MAPIO_KILL: - bio->bi_status = BLK_STS_IOERR; - bio_endio(bio); + bio_io_error(bio); break; case DM_MAPIO_REQUEUE: bio->bi_status = BLK_STS_DM_REQUEUE; diff --git a/drivers/nvme/target/io-cmd.c b/drivers/nvme/target/io-cmd.c index 3b4d47a..46baf19 100644 --- a/drivers/nvme/target/io-cmd.c +++ b/drivers/nvme/target/io-cmd.c @@ -145,8 +145,7 @@ static void nvmet_execute_discard(struct nvmet_req *req) bio->bi_private = req; bio->bi_end_io = nvmet_bio_done; if (status) { - bio->bi_status = BLK_STS_IOERR; - bio_endio(bio); + bio_io_error(bio); } else { submit_bio(bio); } diff --git a/fs/block_dev.c b/fs/block_dev.c index 9941dc8..3ceb8f4 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -370,8 +370,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) ret = bio_iov_iter_get_pages(bio, iter); if (unlikely(ret)) { - bio->bi_status = BLK_STS_IOERR; - bio_endio(bio); + bio_io_error(bio); break; }