From patchwork Tue Sep 18 20:58:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10604871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0DA4C6CB for ; Tue, 18 Sep 2018 20:59:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF8432BEAB for ; Tue, 18 Sep 2018 20:59:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3A3E2BEB1; Tue, 18 Sep 2018 20:59:45 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 644282BEAB for ; Tue, 18 Sep 2018 20:59:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729932AbeISCeG (ORCPT ); Tue, 18 Sep 2018 22:34:06 -0400 Received: from com-out001.mailprotect.be ([83.217.72.83]:56899 "EHLO com-out001.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729859AbeISCeG (ORCPT ); Tue, 18 Sep 2018 22:34:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-Id:Date:Subject:Cc:To:From:reply-to:sender:bcc: content-type; bh=l3EIiWyK7gW4ATDEGX2gD8QTAR4Ijs7QieELCzWHE6E=; b=iLwOXrO41sh/ 1+VzZgg29a9KNO+3bcDM1I8ycm91o/361ovKRvka3IvRQ7vS+2v3TGBFyCnZBkpp5IBUmwbQVJGeV GVW/05/rFpNLECMSfoVZwlSlZpEIUfiSnfZzOVKZ+pvCA0wscPfos5NaTzNGuMHFGBkym+BdobzbB 5iXq2Jc52lIfD6dW+duYEveJPpKYAycD+R3H4loaGFw7ERohRpxB10fTDxFoRMcTd8M8bUkk4qut6 doZycoCa/f5bxe+FG/9qYIjMOdV+6cos+Ng2kSZf07r5H0RWIUdbrm0/NTNif9jdqcMzt4L8Rr3DR jGxvX7rJejsR0SH2rFqjrg==; Received: from smtp-auth.mailprotect.be ([178.208.39.159]) by com-mpt-out001.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1g2N5f-000FVL-JU; Tue, 18 Sep 2018 22:59:24 +0200 Received: from asus.hsd1.ca.comcast.net (c-174-62-111-89.hsd1.ca.comcast.net [174.62.111.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.mailprotect.be (Postfix) with ESMTPSA id 8AD5EC09A6; Tue, 18 Sep 2018 22:59:20 +0200 (CEST) From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Ming Lei , Jianchao Wang , Hannes Reinecke , Johannes Thumshirn Subject: [PATCH v8 1/8] blk-mq: Document the functions that iterate over requests Date: Tue, 18 Sep 2018 13:58:56 -0700 Message-Id: <20180918205903.15516-2-bvanassche@acm.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180918205903.15516-1-bvanassche@acm.org> References: <20180918205903.15516-1-bvanassche@acm.org> MIME-Version: 1.0 X-Originating-IP: 178.208.39.159 X-SpamExperts-Domain: mailprotect.be X-SpamExperts-Username: 178.208.39.128/27 Authentication-Results: mailprotect.be; auth=pass smtp.auth=178.208.39.128/27@mailprotect.be X-SpamExperts-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3kDJQ3+6q4AlHWfFiKC1INpQMsHcYox7c7ZsoYwS+KCiB8pTPkce0ip05dLwfzN0 WaDweGoFjgVERfb2WRDymz+2tgZkcRkCnoMzps1w8ZlyWgD9hJfBmJfMRsiZuwnxy0yeAs6tSdE8 TNQC3wbhPzhsZyCgxZHINA6A5+7T9o6by3fyJMzeSPO4me587e7DP/mB4b82Bi5RHSD5admVNAUi ewe6zWtZQMrfF7bZB6+xNjEvuGslKTrRIXcXpFg5ivY= X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be 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 Make it easier to understand the purpose of the functions that iterate over requests by documenting their purpose. Fix two minor spelling mistakes in comments in these functions. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn --- block/blk-mq-tag.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index 94e1ed667b6e..ef3acb4a80e0 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c @@ -232,13 +232,19 @@ static bool bt_iter(struct sbitmap *bitmap, unsigned int bitnr, void *data) /* * We can hit rq == NULL here, because the tagging functions - * test and set the bit before assining ->rqs[]. + * test and set the bit before assigning ->rqs[]. */ if (rq && rq->q == hctx->queue) iter_data->fn(hctx, rq, iter_data->data, reserved); return true; } +/* + * Call function @fn(@hctx, rq, @data, @reserved) for each request queued on + * @hctx that has been assigned a driver tag. @reserved indicates whether @bt + * is the breserved_tags member or the bitmap_tags member of struct + * blk_mq_tags. + */ static void bt_for_each(struct blk_mq_hw_ctx *hctx, struct sbitmap_queue *bt, busy_iter_fn *fn, void *data, bool reserved) { @@ -280,6 +286,11 @@ static bool bt_tags_iter(struct sbitmap *bitmap, unsigned int bitnr, void *data) return true; } +/* + * Call function @fn(rq, @data, @reserved) for each request in @tags that has + * been started. @reserved indicates whether @bt is the breserved_tags member + * or the bitmap_tags member of struct blk_mq_tags. + */ static void bt_tags_for_each(struct blk_mq_tags *tags, struct sbitmap_queue *bt, busy_tag_iter_fn *fn, void *data, bool reserved) { @@ -294,6 +305,10 @@ static void bt_tags_for_each(struct blk_mq_tags *tags, struct sbitmap_queue *bt, sbitmap_for_each_set(&bt->sb, bt_tags_iter, &iter_data); } +/* + * Call @fn(rq, @priv, reserved) for each started request in @tags. 'reserved' + * indicates whether or not 'rq' is a reserved request. + */ static void blk_mq_all_tag_busy_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn, void *priv) { @@ -302,6 +317,10 @@ static void blk_mq_all_tag_busy_iter(struct blk_mq_tags *tags, bt_tags_for_each(tags, &tags->bitmap_tags, fn, priv, false); } +/* + * Call @fn(rq, @priv, reserved) for each request in @tagset. 'reserved' + * indicates whether or not 'rq' is a reserved request. + */ void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset, busy_tag_iter_fn *fn, void *priv) { @@ -314,6 +333,11 @@ void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset, } EXPORT_SYMBOL(blk_mq_tagset_busy_iter); +/* + * Call @fn(rq, @priv, reserved) for each request associated with request + * queue @q or any queue it shares tags with and that has been assigned a + * driver tag. 'reserved' indicates whether or not 'rq' is a reserved request. + */ void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_iter_fn *fn, void *priv) { @@ -337,7 +361,7 @@ void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_iter_fn *fn, struct blk_mq_tags *tags = hctx->tags; /* - * If not software queues are currently mapped to this + * If no software queues are currently mapped to this * hardware queue, there's nothing to check */ if (!blk_mq_hw_queue_mapped(hctx))