Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp810052iog; Wed, 15 Jun 2022 12:52:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sj4cQMaHWuU5gDqmYP/F71Y0TSiBr2KHGuJoRD+Rkyil+navXgwKXc2cdmhYMPDSyrvt0T X-Received: by 2002:a17:903:2cb:b0:14f:4fb6:2fb0 with SMTP id s11-20020a17090302cb00b0014f4fb62fb0mr1125605plk.172.1655322754031; Wed, 15 Jun 2022 12:52:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655322754; cv=none; d=google.com; s=arc-20160816; b=pWADEVw3xIoi/vBGgywl15YkJ81Knv30TqfUdjlU0MOgbFQwNfrk6ZTSdMSoFsepxM 8y2XGMWIJmVPvpG2tQk0TICmcQhZk/SRmjAQzP5s/yzfPaErsEr+tLd+pfB7gNCiX7YR sct8Q5jQaEaLzAJ5r16zTT8G84bNhvb3sequL/OGp0PiLhUaPdlbu0EULA6H0vyEMT/B eFrcao4vj73LiAs5c929NuGxIFV48LlSKqJdbxGaqCce3LRKSW+Qe1fQVoPxXgyPTKgb g1gyUeIhcgkJkpQ4N9IcxUDDa53wsNdec/Uouf9OBYl3VHV2q51p73qEw85b5zFr6nqc Bp8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=9JwBmH/vMb6FUF38fstezt7AfWtaCDaYMbLS69TYfBU=; b=CuCdfHu9x3/AY7XBMlj7unBouHtjBSHaMUHS2rrQTEQRhKUS25pfBdKCxUxNO+5zF/ b0mYoPr+PGKLRnwVTVBuRuXdf62QXsd6+ArLBrI66Jrsi0KD+vZgsh7C5mRkFyxpysKK gAoHWLRjde1ETvtsANdmPM+pyF6dvdw9zgl2TJzpa3fyxUjdn/2B43ZKMsJbAfLZSbrj BfILmN0P24ioDM/LYGCl8t6ElwV1vV8Utimh4e8dEt4MKvAF1CtC8h+XnpcUOoM9/eOr qk+JBJJhOjzfBnqJ/nU+B35QXxyKb9Yps15o0zvHZMLtIkxiO5kHBrG6wIdjWdpUUNZw hdgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020aa788cd000000b0050ebd76abccsi132867pff.2.2022.06.15.12.52.20; Wed, 15 Jun 2022 12:52:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344239AbiFOSiM (ORCPT + 99 others); Wed, 15 Jun 2022 14:38:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245372AbiFOSiK (ORCPT ); Wed, 15 Jun 2022 14:38:10 -0400 Received: from smtp.smtpout.orange.fr (smtp08.smtpout.orange.fr [80.12.242.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 886C627B3A for ; Wed, 15 Jun 2022 11:38:09 -0700 (PDT) Received: from [192.168.1.18] ([90.11.190.129]) by smtp.orange.fr with ESMTPA id 1Xu2oIs6ogNxB1Xu2o39DQ; Wed, 15 Jun 2022 20:38:07 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Wed, 15 Jun 2022 20:38:07 +0200 X-ME-IP: 90.11.190.129 Message-ID: Date: Wed, 15 Jun 2022 20:38:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] block: Directly use ida_alloc()/free() Content-Language: fr To: Bo Liu , axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220615081816.4342-1-liubo03@inspur.com> From: Christophe JAILLET In-Reply-To: <20220615081816.4342-1-liubo03@inspur.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 15/06/2022 à 10:18, Bo Liu a écrit : > Use ida_alloc()/ida_free() instead of > ida_simple_get()/ida_simple_remove(). > The latter is deprecated and more verbose. > > Signed-off-by: Bo Liu Hi, for what it's worth: Reviewed-by: Christophe JAILLET > --- > block/blk-core.c | 4 ++-- > block/blk-sysfs.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/block/blk-core.c b/block/blk-core.c > index 06ff5bbfe8f6..eb86c756a7fd 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -448,7 +448,7 @@ struct request_queue *blk_alloc_queue(int node_id, bool alloc_srcu) > > q->last_merge = NULL; > > - q->id = ida_simple_get(&blk_queue_ida, 0, 0, GFP_KERNEL); > + q->id = ida_alloc(&blk_queue_ida, GFP_KERNEL); > if (q->id < 0) > goto fail_srcu; > > @@ -498,7 +498,7 @@ struct request_queue *blk_alloc_queue(int node_id, bool alloc_srcu) > fail_split: > bioset_exit(&q->bio_split); > fail_id: > - ida_simple_remove(&blk_queue_ida, q->id); > + ida_free(&blk_queue_ida, q->id); > fail_srcu: > if (alloc_srcu) > cleanup_srcu_struct(q->srcu); > diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c > index 14607565d781..2ed9e7d52b47 100644 > --- a/block/blk-sysfs.c > +++ b/block/blk-sysfs.c > @@ -799,7 +799,7 @@ static void blk_release_queue(struct kobject *kobj) > if (blk_queue_has_srcu(q)) > cleanup_srcu_struct(q->srcu); > > - ida_simple_remove(&blk_queue_ida, q->id); > + ida_free(&blk_queue_ida, q->id); > call_rcu(&q->rcu_head, blk_free_queue_rcu); > } >