Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp368720imm; Thu, 28 Jun 2018 22:23:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpediujGmItTuwMUoTmSGxwK2BA8u8GJZOT171ASKP4pqs7mHOR+s2RTufaKkDgU3FY8HIA6 X-Received: by 2002:a63:790b:: with SMTP id u11-v6mr9198341pgc.111.1530249796101; Thu, 28 Jun 2018 22:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530249796; cv=none; d=google.com; s=arc-20160816; b=dmty5iABp/2PmRTcTJ2Lo0TexNHRD9NoMdgbweQH/MuWTUkQ7cWFgfIYjIKYIraFMz hy9WSocy8HR54gc4UepZHLbn5wx6HR/GqkZz7oSohP1Mx9q+SXvtuhTTl4UqbvfRd3zk CGZ9ag77XDZnlq5QKxLQYHVqf9aVJGzZK2Qkx1fV/8PhOdWA2qX3Ah1eq88vHHfbqgAD MG+nx7/J05nfnNbmKKuLOUN2Vs0YOZwhwjnmrXZtK/MbD8o8uz2zBmR8WPsRh6r78lkj HxtaVNhYnzDWyZHLqZj58t7FBnN4CORupHj4FvPSlcUiQ+ak+UqorjGB7BxVwCmLnb18 j8qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8uz7WnrFW1nnsu6b127K80g6dTSTwiqKxA4GzVFeVtU=; b=SwnuI1giA/7OpQHT3zEztRNyxeoi2og79hzbIpDBWHoaRGijUVOO7LkjJHIdi+iqCy AHxUP3FRfxjkwdsL2vwMGA6Q9w2kO+PFzwPrsjZJMspQvK2iCWptqBLY+dMtY5FUn+XF Nux6g1mkmdLqawouWAfTex3h2s6e53UGxykv1vlShlsVnFP7lLVXVel+96p8nIOibIke X489mAghMvqBkoGfWKi4yVk0qvcdMKZVH600SQ0MTkgIsS48RHLM1oIuy/vL8IGhCmgJ QDkCLcL2rbaWSjLhQ0+64pGizd+j7aG1CUYjAxVMZbDLbbe90sHpVLc8oNABp3IbXzke iR3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q68-v6si5453353pfl.317.2018.06.28.22.23.02; Thu, 28 Jun 2018 22:23:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965402AbeF1U5f (ORCPT + 99 others); Thu, 28 Jun 2018 16:57:35 -0400 Received: from mga09.intel.com ([134.134.136.24]:31846 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935840AbeF1U5N (ORCPT ); Thu, 28 Jun 2018 16:57:13 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 13:57:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,284,1526367600"; d="scan'208";a="50702319" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by fmsmga007.fm.intel.com with ESMTP; 28 Jun 2018 13:56:56 -0700 From: Keith Busch To: Johannes Thumshirn , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Jens Axboe Cc: Keith Busch Subject: [PATCH 1/5] blk-mq: add API to get hctx index from request Date: Thu, 28 Jun 2018 14:55:57 -0600 Message-Id: <20180628205601.13742-1-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Keith Busch --- block/blk-mq.c | 6 ++++++ include/linux/blk-mq.h | 1 + 2 files changed, 7 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index b429d515b568..c6478833464d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -466,6 +466,12 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q, } EXPORT_SYMBOL_GPL(blk_mq_alloc_request_hctx); +unsigned int blk_mq_request_hctx_idx(struct request *rq) +{ + return blk_mq_map_queue(rq->q, rq->mq_ctx->cpu)->queue_num; +} +EXPORT_SYMBOL_GPL(blk_mq_request_hctx_idx); + static void __blk_mq_free_request(struct request *rq) { struct request_queue *q = rq->q; diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index e3147eb74222..af91b2d31a04 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -248,6 +248,7 @@ static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag) } +unsigned int blk_mq_request_hctx_idx(struct request *rq); int blk_mq_request_started(struct request *rq); void blk_mq_start_request(struct request *rq); void blk_mq_end_request(struct request *rq, blk_status_t error); -- 2.14.3