From patchwork Sun Feb 10 17:22:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcos Paulo de Souza X-Patchwork-Id: 10804857 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 11C7E1575 for ; Sun, 10 Feb 2019 17:22:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F32C7289A2 for ; Sun, 10 Feb 2019 17:22:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6BD829CE0; Sun, 10 Feb 2019 17:22:08 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 8D6D5289A2 for ; Sun, 10 Feb 2019 17:22:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726207AbfBJRWH (ORCPT ); Sun, 10 Feb 2019 12:22:07 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:35507 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbfBJRWH (ORCPT ); Sun, 10 Feb 2019 12:22:07 -0500 Received: by mail-qt1-f195.google.com with SMTP id p48so8198301qtk.2; Sun, 10 Feb 2019 09:22:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=+BGbKnzjyDx8WuUGVQrygvBh91FJ8/nYvqrgX2NjAj8=; b=laa7rfJ3/aup8ab17Zmd4IqSonpVX4q4GmV4QcO8/ZeAtFCpVZbm05N9FHp2qY2gaB KxK+DnB6uMcbXi0tSrKoxlLbpd1MSyL1Bn1ISm08H0Jbm3pcZWtrTgmvNJO6gVZ+6OMU 0xIi5dhyZVvO7ggy6an+YNqpCRJdo4FVKeN18lZO8cPtMIVd2bJuQGuof3IzWCWFwcqX P7emHGapxib4kSg3DTm79MxgGe6gXgPyzYrLM8BPq4Bn3d0r+dcc5tY6UZl47ibvGx1l 7RLlpumcAOK/7N4Kmlb7krm2T74/JWvvO3VDAQawK7Nq3+dvCcnY2a0xXncRVAV4mmTn rtrg== 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; bh=+BGbKnzjyDx8WuUGVQrygvBh91FJ8/nYvqrgX2NjAj8=; b=enbEBnBcXmXrr3XTXRvPfE/lt8ambu+jdqKQ//fk8xMeoRktW13OahLSfNTK3hI06G qoHHrX9JJBGKqWM/ksdknuPa39yEigiiUSd5BKfRQnsB/E8gJBCISbjl1Otj72l5od6/ A6Oe0+KR9bDIaxP6u5N8bAuR4CcqlawyZFMTvXGQWI/qYTnMlU4kopuLE+ZHzhniXjgX 7js2Ozu++fUIg51YAEm3jlhjOPAhs7XfD2sPu7Uresn/Ff22y7RCOx2ZjpK8mKJeGTEb dlaMWa5d7vIh9KeeIJQOT3wL2n+69WNpezWE/OYXUpXT1sI+eu6SemZCrBk/XSSYnXyo RlOA== X-Gm-Message-State: AHQUAuaDYXFSki0fMhZq0wg9Z4MvtchhLjM7HizNuy4I9RRJF1EFXbDm aI3RjGsZYH/RqIUNJtjLxPJEFBkKwss= X-Google-Smtp-Source: AHgI3Ia6sf3/hhwRzRvvH7muBi5C/t53A1y9Ay+8nGeBrBGPwLODmNYBJ295N27OnjUCdYsxj35WOQ== X-Received: by 2002:ac8:4453:: with SMTP id m19mr14065268qtn.303.1549819325855; Sun, 10 Feb 2019 09:22:05 -0800 (PST) Received: from localhost.localdomain (189.26.177.147.dynamic.adsl.gvt.net.br. [189.26.177.147]) by smtp.gmail.com with ESMTPSA id e4sm6150690qkg.15.2019.02.10.09.22.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 09:22:04 -0800 (PST) From: Marcos Paulo de Souza To: linux-kernel@vger.kernel.org Cc: Marcos Paulo de Souza , Jens Axboe , linux-block@vger.kernel.org (open list:BLOCK LAYER) Subject: [PATCH v2] blk-sysfs: Rework documention of __blk_release_queue Date: Sun, 10 Feb 2019 15:22:51 -0200 Message-Id: <20190210172251.17531-1-marcos.souza.org@gmail.com> X-Mailer: git-send-email 2.16.4 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 The Notes section of the comment was removed, because now blk_release_queue can only be executed from blk_cleanup_queue (being called when the q->kobj reaches zero), and also blk_init_queue was removed in a1ce35fa4985. Signed-off-by: Marcos Paulo de Souza --- Changes from v1: * Typos, suggested by Jens Axboe block/blk-sysfs.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 590d1ef2f961..94e1b052abbc 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -817,21 +817,16 @@ static void blk_free_queue_rcu(struct rcu_head *rcu_head) } /** - * __blk_release_queue - release a request queue when it is no longer needed + * __blk_release_queue - release a request queue * @work: pointer to the release_work member of the request queue to be released * * Description: - * blk_release_queue is the counterpart of blk_init_queue(). It should be - * called when a request queue is being released; typically when a block - * device is being de-registered. Its primary task it to free the queue - * itself. - * - * Notes: - * The low level driver must have finished any outstanding requests first - * via blk_cleanup_queue(). - * - * Although blk_release_queue() may be called with preemption disabled, - * __blk_release_queue() may sleep. + * This function is called when a block device is being unregistered. The + * process of releasing a request queue starts with blk_cleanup_queue, which + * set the appropriate flags and then calls blk_put_queue, that decrements + * the reference counter of the request queue. Once the reference counter + * of the request queue reaches zero, blk_release_queue is called to release + * all allocated resources of the request queue. */ static void __blk_release_queue(struct work_struct *work) {