From patchwork Mon Feb 27 17:47:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9593653 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 8F71060471 for ; Mon, 27 Feb 2017 17:49:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 857D82835B for ; Mon, 27 Feb 2017 17:49:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A763283FD; Mon, 27 Feb 2017 17:49: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=-6.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 158262840E for ; Mon, 27 Feb 2017 17:49:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751422AbdB0Rtw (ORCPT ); Mon, 27 Feb 2017 12:49:52 -0500 Received: from mail-pg0-f41.google.com ([74.125.83.41]:33271 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751341AbdB0Rtu (ORCPT ); Mon, 27 Feb 2017 12:49:50 -0500 Received: by mail-pg0-f41.google.com with SMTP id 25so17473184pgy.0 for ; Mon, 27 Feb 2017 09:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=5Fh4Ba72PunxiKz0vbdftDLpc0uUMdw4AuYcnSZp8Lo=; b=lrQEBvGNvDucYlEcchvrdmkDb9DtY9StjSQ5zhpEMm88QCka6Nh0rJHMwPcVUvVdgK pvDNCNlRdu8Gs0KQSXut02n7oqnEK5w2BrHJVfuLa7uVyk6EhsL9MSfoD8YXOnqKgh7r czCQGn7Ryzm10z6hqb7a6Se2rhnaEuxTbncgHQzgskubnMAg0h5MQbIRIJYdf+dUIRNZ ATSZzO9dXjB4ARSYOL+B5aRx4+nW8JxCO8gUs6g71u5mBo38CvYQGFZ591ljxNNW+h2X u/llU0UEhO7AVy0+b1TCYnjjmJkb0vEqYTShLdYzn28v4vTz0BW/Pr/1TFSqWdCdccOs BsJQ== 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:in-reply-to:references; bh=5Fh4Ba72PunxiKz0vbdftDLpc0uUMdw4AuYcnSZp8Lo=; b=eFDUECznj1P5Ah3+7KhyXZRkL7Lt9bC7Olxaz+fHnm94XSMkwb4ud02KpbPNPKjwl4 OXvNGWvOT8aEzEGymQn4bQ8KvJVDOY0jbRZY7FJnb4Q31B/wUd3SIfVednZxVFyEVzwx F0oiOy0nqaGRA7Phc70DqlgvxQVKL/58RJNEajfsyhOWP4Rs+u8uiygeh9wCzYq7GdTi K6BWqx5/saZOpKbQLz+Ac2xuw54R5K1xwxmTHTp624MXQZKgXZe2MoYBtOGFDlybI4er PUz3bO1QWHmgf+2XYJJL3EzM6jybGAx1PG0OXfu7gnJSBaMMeNYQOLP5/egHD9sGaR3B mB0w== X-Gm-Message-State: AMke39kd+kFEDU166TojmtvaljspIr23jlj5pCodupxOu92GYaHGighEowIiHX1pg9DElj7C X-Received: by 10.84.149.102 with SMTP id b35mr26108323plh.3.1488217724358; Mon, 27 Feb 2017 09:48:44 -0800 (PST) Received: from vader.thefacebook.com ([2620:10d:c090:180::93d5]) by smtp.gmail.com with ESMTPSA id o24sm31893041pfj.78.2017.02.27.09.48.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Feb 2017 09:48:43 -0800 (PST) From: Omar Sandoval To: Jens Axboe , Sagi Grimberg , linux-block@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH 3/3] blk-mq: move update of tags->rqs to __blk_mq_alloc_request() Date: Mon, 27 Feb 2017 09:47:55 -0800 Message-Id: <4715cce107df8b579734a074093a34001efd01d0.1488217516.git.osandov@fb.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: In-Reply-To: References: 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 From: Omar Sandoval No functional difference, it just makes a little more sense to update the tag map where we actually allocate the tag. Signed-off-by: Omar Sandoval --- Optional cleanup, since there's only one place that does this. block/blk-mq-sched.c | 2 -- block/blk-mq.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 5697b23412a1..09af8ff18719 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -134,8 +134,6 @@ struct request *blk_mq_sched_get_request(struct request_queue *q, rq = __blk_mq_alloc_request(data, op); } else { rq = __blk_mq_alloc_request(data, op); - if (rq) - data->hctx->tags->rqs[rq->tag] = rq; } if (rq) { diff --git a/block/blk-mq.c b/block/blk-mq.c index cc9713f574a5..452c1caf978f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -234,6 +234,7 @@ struct request *__blk_mq_alloc_request(struct blk_mq_alloc_data *data, } rq->tag = tag; rq->internal_tag = -1; + data->hctx->tags->rqs[rq->tag] = rq; } blk_mq_rq_ctx_init(data->q, data->ctx, rq, op);