From patchwork Mon Sep 19 21:27:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9340579 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 D753660B16 for ; Mon, 19 Sep 2016 21:29:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C953B29910 for ; Mon, 19 Sep 2016 21:29:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDF1A29913; Mon, 19 Sep 2016 21:29:07 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 2BE7329921 for ; Mon, 19 Sep 2016 21:29:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932714AbcISV3G (ORCPT ); Mon, 19 Sep 2016 17:29:06 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:15941 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932641AbcISV3D (ORCPT ); Mon, 19 Sep 2016 17:29:03 -0400 X-IronPort-AV: E=Sophos;i="5.30,363,1470672000"; d="scan'208";a="15969681" Received: from mail-bn3nam01lp0180.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.180]) by ob1.hgst.iphmx.com with ESMTP; 20 Sep 2016 05:28:09 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-hgst-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=03wEvHuLBb6dzElhIr8rAYVlg/0rMMaYSuM3qr+oDw4=; b=p7jdIZ9An2I1quSdnnYAxiJ3ohHV055A/F/YYNoOFL3K/rivzrGdQ7WFxYnBFBIU0/2MUF+qSUDQ/aQaOxxs7i2pXtKNHozM93kXh6QYTJuwITaPpwJ9il/lGWBVCgvB4drgjL2vDZmsIrHHRlIaQL3gycmexFuF/pD4iEL8Rvg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@hgst.com; Received: from localhost.localdomain.localdomain (4.28.11.153) by BY2PR04MB1975.namprd04.prod.outlook.com (10.166.111.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Mon, 19 Sep 2016 21:28:06 +0000 From: Damien Le Moal To: , CC: , , , , Hannes Reinecke , Damien Le Moal Subject: [PATCH 7/9] block: Add 'BLK_MQ_RQ_QUEUE_DONE' return value Date: Tue, 20 Sep 2016 06:27:32 +0900 Message-ID: <1474320454-5264-8-git-send-email-damien.lemoal@hgst.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474320454-5264-1-git-send-email-damien.lemoal@hgst.com> References: <1474320454-5264-1-git-send-email-damien.lemoal@hgst.com> MIME-Version: 1.0 X-Originating-IP: [4.28.11.153] X-ClientProxiedBy: BY2PR12CA0038.namprd12.prod.outlook.com (10.160.121.48) To BY2PR04MB1975.namprd04.prod.outlook.com (10.166.111.15) X-MS-Office365-Filtering-Correlation-Id: d5c08306-9ac0-444e-a970-08d3e0d3d967 X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 2:BNvPuMc8Uc6vPJ/GTWJd5Em/ltNXFGOUidfgCZogJh+rqYOg/DCwEGI+/6isjdBr06hI8NkahTlFfDhzcTuMjtBlZZhJ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qZweRsxXmjgRmFcuRaKdZy X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 31:Mntj1IRYImGq33CFNLGcA4koak8SQPiwpeotxBM5slSN1ryTe0SJaT2ecKRoElH0RIlifx8dPgoN781YlK6iPETUDf1YOzBfTFx8OzOlB77SRMwtzVdQodsI82jafTdFipp3WKnprQw43Hdl3bIDthubwdYda34BMPKWfSghur1ObWtlQGmDpz1Nq8k+FlWedl6yG84hfHEAVKaFMlSMjLhVYGdAyrEdXvhKAYegjUw=; 20:ASUrY/UILwfz5qqlWxm1xhmMLGMvpKv3y0ivRgSZqoclCaRMKC0hd9uwlnEAt8MmkmXqFQYrzQU7kmPhEyqjoJE8lTEwELww9qfHvF4UsZJ/HyxCb9lpRZyVgg7LmbQ3HoHv8tn9LBgUwnBupeWQKNUbojXYFDPAWAjLBIdppV+/JM6x0pJtPaQY9rlOUuO7SO5a8DfQqlOXI/78PnPZKf9aMSWVUqK+EeNeqrnLDOT5xm/KOuuwb3EHDDLNBIhqi7eJ9X6qNTJ9g9byyl81sqp3IdAoJGSOnCbxXbGYxrkguEE1Zr3X7texzNdcvtavTUAIjijGONk4NLNu0UheIakwuopJALs92ShT5P5+Q1uVi2Rq9w+EVJO9Wkk38el9WHp4IsteW0S22pSz4jWb5Aiyzwp9trTwSC/wRjUltJMZBIWApIxy3BiwReCsXMlSMtMs6HZIPfKAzb1T8Ljk0T295Rt+PW4YfPcgVX403zEmHoiqiZjtNC45t5X/QX3C X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(79135771888625); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:BY2PR04MB1975; BCL:0; PCL:0; RULEID:; SRVR:BY2PR04MB1975; X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 4:dsKG/j3SP8EA8u1UcByYhrU1e7lUtUmly5xcdaEjen8FD0AwvrPB2tt8mBffS4Bf2A4oBB18YjJMt58+2YGQ+mGou7ahYsKcKjq9yP6jS3WawVXIeLiVsfzATz6+8qyjb9Suf6970oAKr6QDmCvC0ZSYnUCPXifOGABfqu26W7lM1FtUf0WZf4NdquJTcMiGU1moa0ddT18p9wcxKyxYVIQOoytUDcbbUVZPZOP70cgHlkUIxJIn+unenI9y4y4OjEY2GlQ8FKB1+RcAuu7x4Qw1yEYJfPNYfi++6M8k41ePspi401ZF93jBrEp+9m4PmIGYZtbYyEBW0CQFjsTNwNMPSFhz9sG8UUV4KJcguU+a+kpkEXNRrMEFjNIRK2Sku+vTVGjpOJQIObZgP6KpNozQdx1USorJVQQPsZVrpZsgoWvY1ofQncZlR2wYFRblHkCLczXfzd0eY9z5lyVLFw== X-Forefront-PRVS: 0070A8666B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(199003)(51234002)(189002)(4001430100002)(305945005)(5660300001)(2950100001)(5003940100001)(86362001)(47776003)(33646002)(66066001)(97736004)(5001770100001)(50986999)(2906002)(229853001)(6116002)(4326007)(3846002)(76176999)(189998001)(101416001)(106356001)(105586002)(586003)(42186005)(77096005)(36756003)(50466002)(48376002)(19580405001)(81166006)(37156001)(92566002)(7736002)(8676002)(50226002)(68736007)(19580395003)(81156014)(7846002)(107886002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR04MB1975; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: hgst.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR04MB1975; 23:D+oS7WJp+6HDBHvCFoa9DugGBu1yBGAZYiH9DHfeG?= =?us-ascii?Q?5hRYElkEkgXtXpuocjJJwukDSFSmymEGDGFIJ/oFVvsBlk+7IcZcSltUKxdL?= =?us-ascii?Q?X8Ozlw7t+wg+N4gTIQGcj+mAcoiaKgvOHWNE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uAhVApB6pzJsrenYb49gqq/ieLhTI1lw1c69plMLr0GF3FXLIJgWwyLXYv0iZFGhng/4nnGuTY4yDJ2/7qCL/V3CpKpxV6pODlUXX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1975; 20:fybcOIweef4WJbhCzDvZQrXKLn8KSJHKyQxEZTQGiDMn4cSo4OZO2r1JpGq7CWZHeTdqWusyxLSm6xnt1/c2Iq/zOHsjf1m1lQ2RZ0/qT05TKG1cHrZXoK9q9WpH/lyeI9Sh+URWzB1T1bJe00Sojx5czGQq3oe0nKGOyLlhNUQnnap1ClTElUyM8ttIS/qRq9mWY3loBvzmIljCYnNk+ryyNzmK59/+1qv/vnqWSXpp0tV30Y68lNbyhm7frXII X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2016 21:28:06.2018 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR04MB1975 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: Hannes Reinecke Add a return value BLK_MQ_RQ_QUEUE_DONE to terminate a request without error. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal --- block/blk-mq.c | 1 + drivers/scsi/scsi_lib.c | 3 +++ include/linux/blk-mq.h | 1 + 3 files changed, 5 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index 13f5a6c..6300629 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -851,6 +851,7 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) pr_err("blk-mq: bad return on queue: %d\n", ret); case BLK_MQ_RQ_QUEUE_ERROR: rq->errors = -EIO; + case BLK_MQ_RQ_QUEUE_DONE: blk_mq_end_request(rq, rq->errors); break; } diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index f99504d..793b791 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1805,6 +1805,8 @@ static inline int prep_to_mq(int ret) return 0; case BLKPREP_DEFER: return BLK_MQ_RQ_QUEUE_BUSY; + case BLKPREP_DONE: + return BLK_MQ_RQ_QUEUE_DONE; default: return BLK_MQ_RQ_QUEUE_ERROR; } @@ -1948,6 +1950,7 @@ out: blk_mq_delay_queue(hctx, SCSI_QUEUE_DELAY); break; case BLK_MQ_RQ_QUEUE_ERROR: + case BLK_MQ_RQ_QUEUE_DONE: /* * Make sure to release all allocated ressources when * we hit an error, as we will never see this command diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index e43bbff..07b4888 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -153,6 +153,7 @@ enum { BLK_MQ_RQ_QUEUE_OK = 0, /* queued fine */ BLK_MQ_RQ_QUEUE_BUSY = 1, /* requeue IO for later */ BLK_MQ_RQ_QUEUE_ERROR = 2, /* end IO with error */ + BLK_MQ_RQ_QUEUE_DONE = 3, /* end IO w/o error */ BLK_MQ_F_SHOULD_MERGE = 1 << 0, BLK_MQ_F_TAG_SHARED = 1 << 1,