From patchwork Mon Apr 4 10:00:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 8739681 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5BD899F36E for ; Mon, 4 Apr 2016 10:01:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 879DF201FA for ; Mon, 4 Apr 2016 10:01:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91AA220279 for ; Mon, 4 Apr 2016 10:01:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751885AbcDDKA4 (ORCPT ); Mon, 4 Apr 2016 06:00:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:60412 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754543AbcDDKAo (ORCPT ); Mon, 4 Apr 2016 06:00:44 -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 mx2.suse.de (Postfix) with ESMTP id 3681AACBC; Mon, 4 Apr 2016 10:00:41 +0000 (UTC) From: Hannes Reinecke To: Jens Axboe Cc: linux-block@vger.kernel.org, "Martin K. Petersen" , Christoph Hellwig , Shaun Tancheff , Damien Le Moal , linux-scsi@vger.kernel.org, Sathya Prakash , Hannes Reinecke , Hannes Reinecke Subject: [PATCH 8/9] block: Add 'BLK_MQ_RQ_QUEUE_DONE' return value Date: Mon, 4 Apr 2016 12:00:19 +0200 Message-Id: <1459764020-126038-9-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1459764020-126038-1-git-send-email-hare@suse.de> References: <1459764020-126038-1-git-send-email-hare@suse.de> 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Add a return value BLK_MQ_RQ_QUEUE_DONE to terminate a request without error. Signed-off-by: Hannes Reinecke --- 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 050f7a1..8b863b7 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -793,6 +793,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 1cc75fb..7cb66b0 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1891,6 +1891,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; } @@ -2034,6 +2036,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 15a73d4..ab107a8 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -151,6 +151,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,