From patchwork Mon Oct 29 16:34:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10659597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F3EA13B5 for ; Mon, 29 Oct 2018 16:35:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0377C29C31 for ; Mon, 29 Oct 2018 16:35:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC22D29C43; Mon, 29 Oct 2018 16:35: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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 9180429C40 for ; Mon, 29 Oct 2018 16:35:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727947AbeJ3BY0 (ORCPT ); Mon, 29 Oct 2018 21:24:26 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:38669 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727862AbeJ3BYZ (ORCPT ); Mon, 29 Oct 2018 21:24:25 -0400 Received: by mail-io1-f68.google.com with SMTP id q18-v6so5369242iod.5 for ; Mon, 29 Oct 2018 09:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7OyvgiCc3J4GeMX28vy0xfyvb/Y/ZUnCj2KzFLrudt0=; b=Zg2TSExpA3/VIa+zY5sJ+3JelsgBcYlxB7cxmOsjfnGoM0uQeFmehjHQWQ+WOmmaLr 7imNHTP7meRTfvcmLS5BIMJOi4g1BVJY1smS3D6oEq+T18Y+EoGUjCvr/t/kRhjdHy2z Nq02cdpLtt4RZ+ar+j4zuweliYQ1vXivTqhQHoEiiNsKkq0ifw+vm4oodAD8LGQ2EucQ CG+ff0zSKr2yX2mWm73BXncKAh6cBBUNAizxvH1S7UsTrs/CGEAm24AlggsMNedD2p3N /vQpGOC8BY9F2snWOtzwhbIbhcmSsOY3o5hBc+0szfnCq9TC6Jy0eFXGuCkP8FbkD09f hRsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7OyvgiCc3J4GeMX28vy0xfyvb/Y/ZUnCj2KzFLrudt0=; b=KWOVKx9A3/G2kqwDbFkwrvg0UYH1/23us5lKzasZCIDVeIs4aV9PI3gvQp8QT3HQWN GJYISOg2YSHsKbXM3MovvCUKmJFRGzGU2FyNzqqRFuKpf8k9x57+wmguHnmDWfUnD23q nSusYgL1mCK2tC9V3dJEKl90JkRYbrXx3dN1cC6OZWyhI/gqSwExXuO3XTSbCLOJ66Fq 0hLLQ10JJlehDdZj+nA6AumKk8XKAnd+8tdJWiUjjOZ0oKhWxU8/Kc71Wu6yLNXNc21y 9JMfjcACMgh7NGpSEh6CWsf3yzxnR5SJ6ZEtiFUkiVgzMRtt6bYvKoTZQH9IDJYxBEaU i6vA== X-Gm-Message-State: AGRZ1gKp7wAg/hvkPwHRdGCXpOB45Avj9p7nnDt0GfuX/AK2pHY9nukr zQ3ufYBxbXY6dh3j/Dc13uilUA== X-Google-Smtp-Source: AJdET5cPhuDlElUptqYdMbnhGmKfrIrazKRGUDzxU0UJSYz0zZ8W0z6u1CS7hccOUOFa8pI+sJsoEA== X-Received: by 2002:a6b:90c6:: with SMTP id s189-v6mr8589126iod.172.1540830905004; Mon, 29 Oct 2018 09:35:05 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id n7-v6sm6464500itb.22.2018.10.29.09.35.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 09:35:03 -0700 (PDT) From: Jens Axboe To: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 08/29] scsi: provide mq_ops->busy() hook Date: Mon, 29 Oct 2018 10:34:23 -0600 Message-Id: <20181029163444.9940-9-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181029163444.9940-1-axboe@kernel.dk> References: <20181029163444.9940-1-axboe@kernel.dk> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Only the SCSI legacy path provides a way to check if target is currently busy, provide the same for the MQ path. Cc: linux-scsi@vger.kernel.org Signed-off-by: Jens Axboe Reviewed-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index c7fccbb8f554..8b0345924a92 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1675,6 +1675,11 @@ static int scsi_lld_busy(struct request_queue *q) return 0; } +static bool scsi_mq_lld_busy(struct request_queue *q) +{ + return scsi_lld_busy(q); +} + /* * Kill a request for a dead device */ @@ -2326,6 +2331,7 @@ static const struct blk_mq_ops scsi_mq_ops = { .init_request = scsi_mq_init_request, .exit_request = scsi_mq_exit_request, .initialize_rq_fn = scsi_initialize_rq, + .busy = scsi_mq_lld_busy, .map_queues = scsi_map_queues, };