Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1669517pxa; Sun, 23 Aug 2020 11:40:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBweXRr9KHSjQBAx0D3ZF+bAY2MHArghXH9S2Go6iMZxmfPADG0qEL3NQBKgbw6Dfd6ako X-Received: by 2002:a05:6402:2057:: with SMTP id bc23mr2315291edb.179.1598208014378; Sun, 23 Aug 2020 11:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598208014; cv=none; d=google.com; s=arc-20160816; b=Mgb3zAqH6uP+zTVx4Z4s9nuzJ3AO+AiaWf0A4QTRnDaMocB84V9f8OGBRRzWYKoN15 LNEh30KrNeLz1MtGbYxiT5zv8l8WPHXbSwiss7OHX7fZ+BQeOkXbyO4bIImyAgcuzzzB skams2fis8UXtZji8bTohEz1qSq/bsnQGDhUTO0RBiB0IAGU46+ShCi0hAMtnK6hhUiy 8JP1irAFMsoVKHCaz1VuHSdPuSEIvJdgdxhAN1aRPLx1OV8x7TbE3HMOf0pQXBgmn5s6 PQ8opN0jHX68WJeYNHo0R85wXAR5/0zlSOpM0Vq/AfAGe2EFSr/yaal33Y9qjJWBUfjB EErw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=ljZxx6ca+1pSO3dLIAHj3FughCK1sW2f6C7AvQwFtVA=; b=oxODq4TpWvp/wU0jFLnhmUN6CJ67WzOrf1lZanDDe/4Lli6e5gJG8IqqTWM3dojL/O hyzX2ncPKZkJ4kTLYQazNmNwUobRtTkDyjxpuy40orKLWx2R3ML3C/08Fn8rDrKNCC84 6WU7RKmyapnO2als1+4/Zcbs7LMGd7KMKDoSn0e7ZfETlsdiwGz/SUiZRpnX9ZWDOLMC gGWBsCXUMwz8J/ZAlh/bQXlOzQuLD85uRfErv+J+nmIsiDJaDScALz/KJ9jJ85LZGgrA 2tUqHESDvOT7FljkXoMGkI7aIhhGhf/FuPvxxsJ9abjipQZ5Ea3UAvYurDnBY0DvjKaq iXaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j14si5499329ejd.406.2020.08.23.11.39.51; Sun, 23 Aug 2020 11:40:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727894AbgHWRWC (ORCPT + 99 others); Sun, 23 Aug 2020 13:22:02 -0400 Received: from smtp.h3c.com ([60.191.123.50]:10248 "EHLO h3cspam02-ex.h3c.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726792AbgHWRWB (ORCPT ); Sun, 23 Aug 2020 13:22:01 -0400 Received: from h3cspam02-ex.h3c.com (localhost [127.0.0.2] (may be forged)) by h3cspam02-ex.h3c.com with ESMTP id 07NFqcem065411 for ; Sun, 23 Aug 2020 23:52:38 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from DAG2EX03-BASE.srv.huawei-3com.com ([10.8.0.66]) by h3cspam02-ex.h3c.com with ESMTPS id 07NFphto065235 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 23 Aug 2020 23:51:43 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from localhost.localdomain (10.99.212.201) by DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 23 Aug 2020 23:51:47 +0800 From: Xianting Tian To: , , , , , , , , CC: , , Xianting Tian Subject: [PATCH] blk-mq: use BLK_MQ_NO_TAG for no tag Date: Sun, 23 Aug 2020 23:44:59 +0800 Message-ID: <20200823154459.40731-1-tian.xianting@h3c.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.99.212.201] X-ClientProxiedBy: BJSMTP01-EX.srv.huawei-3com.com (10.63.20.132) To DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) X-DNSRBL: X-MAIL: h3cspam02-ex.h3c.com 07NFphto065235 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace various magic -1 constants for tags with BLK_MQ_NO_TAG. Signed-off-by: Xianting Tian --- block/blk-core.c | 4 ++-- block/blk-mq-sched.c | 2 +- include/linux/blk-mq.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index d9d632639..c7eaf7504 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -116,8 +116,8 @@ void blk_rq_init(struct request_queue *q, struct request *rq) rq->__sector = (sector_t) -1; INIT_HLIST_NODE(&rq->hash); RB_CLEAR_NODE(&rq->rb_node); - rq->tag = -1; - rq->internal_tag = -1; + rq->tag = BLK_MQ_NO_TAG; + rq->internal_tag = BLK_MQ_NO_TAG; rq->start_time_ns = ktime_get_ns(); rq->part = NULL; refcount_set(&rq->ref, 1); diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index a19cdf159..439481f59 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -522,7 +522,7 @@ void blk_mq_sched_insert_request(struct request *rq, bool at_head, goto run; } - WARN_ON(e && (rq->tag != -1)); + WARN_ON(e && (rq->tag != BLK_MQ_NO_TAG)); if (blk_mq_sched_bypass_insert(hctx, !!e, rq)) { /* diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 9d2d5ad36..161d8a0e6 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -569,7 +569,7 @@ static inline void *blk_mq_rq_to_pdu(struct request *rq) static inline blk_qc_t request_to_qc_t(struct blk_mq_hw_ctx *hctx, struct request *rq) { - if (rq->tag != -1) + if (rq->tag != BLK_MQ_NO_TAG) return rq->tag | (hctx->queue_num << BLK_QC_T_SHIFT); return rq->internal_tag | (hctx->queue_num << BLK_QC_T_SHIFT) | -- 2.17.1