From patchwork Fri Apr 28 14:55:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9704939 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 23EFA602BE for ; Fri, 28 Apr 2017 14:55:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16A022624A for ; Fri, 28 Apr 2017 14:55:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B92D28662; Fri, 28 Apr 2017 14:55:55 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 BF75F2624A for ; Fri, 28 Apr 2017 14:55:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031932AbdD1Ozy (ORCPT ); Fri, 28 Apr 2017 10:55:54 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:45179 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969516AbdD1Ozv (ORCPT ); Fri, 28 Apr 2017 10:55:51 -0400 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v3SEcCDS016008; Fri, 28 Apr 2017 07:55:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=QtDkZwWvsH1wgehThQiRlHxKG8knOsAgD//UonIyqiI=; b=grS6+Sr2rbxVNdjp+GeqSiQP2Tqo+JzAIrNXol8TOhgao8PYKUzywi6g8azrtldXfGSr eF9w6ont8fOe6r0u7qd1um0l3jVYSi60pArOiuW7joRwqDx6mLZ0jegpwGx53GbzcZ9S uGOI+ZwDpCkkpbhMW1w6fmVwf7Cf4UCIwyo= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2a441k8kae-6 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 28 Apr 2017 07:55:47 -0700 Received: from localhost.localdomain (192.168.54.13) by mail.thefacebook.com (192.168.16.24) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Apr 2017 07:55:45 -0700 From: Jens Axboe To: CC: , , Jens Axboe Subject: [PATCH 4/7] blk-mq: add and export helper to tell if a request is reserved Date: Fri, 28 Apr 2017 08:55:37 -0600 Message-ID: <1493391340-24629-5-git-send-email-axboe@fb.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493391340-24629-1-git-send-email-axboe@fb.com> References: <1493391340-24629-1-git-send-email-axboe@fb.com> MIME-Version: 1.0 X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-04-28_07:, , signatures=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 We only have an internal helper for checking a tag value. Add an exported helper that takes a request and hardware queue, and check against the driver tags. Signed-off-by: Jens Axboe Reviewed-by: Bart Van Assche Reviewed-by: Ming Lei Reviewed-by: Hannes Reinecke --- block/blk-mq-tag.c | 6 ++++++ include/linux/blk-mq.h | 1 + 2 files changed, 7 insertions(+) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index d0be72ccb091..0a04b5c14076 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -476,3 +476,9 @@ u32 blk_mq_unique_tag(struct request *rq) (rq->tag & BLK_MQ_UNIQUE_TAG_MASK); } EXPORT_SYMBOL(blk_mq_unique_tag); + +bool blk_mq_rq_is_reserved(struct blk_mq_hw_ctx *hctx, struct request *rq) +{ + return blk_mq_tag_is_reserved(hctx->tags, rq->tag); +} +EXPORT_SYMBOL_GPL(blk_mq_rq_is_reserved); diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 32bd8eb5ba67..13e51520fa27 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -224,6 +224,7 @@ static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag) return unique_tag & BLK_MQ_UNIQUE_TAG_MASK; } +bool blk_mq_rq_is_reserved(struct blk_mq_hw_ctx *hctx, struct request *rq); int blk_mq_request_started(struct request *rq); void blk_mq_start_request(struct request *rq);