From patchwork Fri Aug 27 12:01:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 503387 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp1197763jab; Fri, 27 Aug 2021 05:07:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwucg7hwjbl2hEu0WHg3eOWabm0WTh/9JrStQbD26WZDm0s7IZe4Ux1nCaY095x5XoVJ/39 X-Received: by 2002:a05:6512:ad6:: with SMTP id n22mr6827839lfu.532.1630066022123; Fri, 27 Aug 2021 05:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630066022; cv=none; d=google.com; s=arc-20160816; b=tn2pXrB/UfJKk/5hEGapTgNcCUJv/gtoE9O7skVj3X4isoJ2BfMxLSTOpnpqkz5vi4 75BiZ7R0R3Q7E9pV9GdIQiqX0wV4iJrNu87Y9Sxk2DxrnnTj0JtGn11t0gncj25c7DGX cyPDoRaFGmUYfVNBc60VPS24VC5aTRFpv7Ne4O+dP3dOqageJq1fzc9i/WSPqh/K8zRI 0EvHJbRpdQKKq8CIkDwbE9Z7hpWy7d5AdThL6G+BLSOLHft+H57YrEHbcsCdCErezQg9 xrFqZmh+ukZGc08j6T08B1QWO8Va1Cds/8ZNr91vVjyAZgvkzf3judNgINzlY05yyj19 G1mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=68KKQh/W8q8WGWkB2m5t/AE64TsmaNufMN+FLJIiOoc=; b=v3cNOQfv3bM6aWHX/IcRg2Wwli1XMu8muVbQkw2AK/osFz0ILKvUmWEO6f4uLbr93C DtJJ7Mo/RZg58bCDCBsdtT3e3S+lDUa9txbjmeHbIXKLpB84vGLKOHNawkki0cXhIQEz Wggmr+RviyFkMvkjun99+UJg8gqjlyu1+iH6YawRm1uKMRnk69yqwP7Z8dgdkoqlXUzH 36vtl4Jkfd9B90kv3w4FxUnpZz5yMukXFSj8JR/gR8+2NUSRODHXejxJvNQ58MWbieQo 9+/vXGTK+jl7LKt6XeTANG9WLmLwClIGVEpIVIEc15GYSbOrqdOrQzy6A1gbw8fYA/pN U5Xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca20si5772834edb.178.2021.08.27.05.07.01 for ; Fri, 27 Aug 2021 05:07:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245111AbhH0MHs (ORCPT ); Fri, 27 Aug 2021 08:07:48 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3699 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245125AbhH0MHr (ORCPT ); Fri, 27 Aug 2021 08:07:47 -0400 Received: from fraeml743-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Gwz1v3Ftdz67YT1; Fri, 27 Aug 2021 20:05:39 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml743-chm.china.huawei.com (10.206.15.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 27 Aug 2021 14:06:56 +0200 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 27 Aug 2021 13:06:54 +0100 From: John Garry To: CC: , , , , John Garry Subject: [PATCH v3 04/13] blk-mq: Invert check in blk_mq_update_nr_requests() Date: Fri, 27 Aug 2021 20:01:55 +0800 Message-ID: <1630065724-69146-5-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1630065724-69146-1-git-send-email-john.garry@huawei.com> References: <1630065724-69146-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org It's easier to read: if (x) X; else Y; over: if (!x) Y; else X; No functional change intended. Signed-off-by: John Garry Reviewed-by: Ming Lei --- block/blk-mq.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.26.2 diff --git a/block/blk-mq.c b/block/blk-mq.c index 2cc5b2952ceb..b51d59ec7d7a 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3621,18 +3621,18 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr) * If we're using an MQ scheduler, just update the scheduler * queue depth. This is similar to what the old code would do. */ - if (!hctx->sched_tags) { - ret = blk_mq_tag_update_depth(hctx, &hctx->tags, nr, - false); - } else { + if (hctx->sched_tags) { ret = blk_mq_tag_update_depth(hctx, &hctx->sched_tags, - nr, true); + nr, true); if (blk_mq_is_sbitmap_shared(set->flags)) { hctx->sched_tags->bitmap_tags = &q->sched_bitmap_tags; hctx->sched_tags->breserved_tags = &q->sched_breserved_tags; } + } else { + ret = blk_mq_tag_update_depth(hctx, &hctx->tags, nr, + false); } if (ret) break;