From patchwork Sat Jun 8 14:34:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 1945501 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=wanadoo.fr header.i=@wanadoo.fr header.a=rsa-sha256 header.s=t20230301 header.b=jWztZ6EV; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=112.213.38.117; helo=lists.ozlabs.org; envelope-from=linux-fsi-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org; receiver=patchwork.ozlabs.org) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VxM1c5xpGz20Q5 for ; Sun, 9 Jun 2024 01:09:56 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=wanadoo.fr header.i=@wanadoo.fr header.a=rsa-sha256 header.s=t20230301 header.b=jWztZ6EV; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4VxM1b3zsjz30Wq for ; Sun, 9 Jun 2024 01:09:55 +1000 (AEST) X-Original-To: linux-fsi@lists.ozlabs.org Delivered-To: linux-fsi@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=wanadoo.fr header.i=@wanadoo.fr header.a=rsa-sha256 header.s=t20230301 header.b=jWztZ6EV; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=wanadoo.fr (client-ip=80.12.242.18; helo=smtp.smtpout.orange.fr; envelope-from=christophe.jaillet@wanadoo.fr; receiver=lists.ozlabs.org) Received: from smtp.smtpout.orange.fr (smtp-18.smtpout.orange.fr [80.12.242.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4VxM1X5SrQz30VP for ; Sun, 9 Jun 2024 01:09:52 +1000 (AEST) Received: from fedora.home ([86.243.222.230]) by smtp.orange.fr with ESMTPA id Fx9Rs04TztVxQFx9hsAXq3; Sat, 08 Jun 2024 16:34:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1717857294; bh=MxuPvXcFH8FAbiPwG6OxtP6h9EO2lNhJCavfueUtjog=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=jWztZ6EVoUlEaMITLyVQXV8Wl8O4L5I8bCtc2ArUUjoekzpq2A2X3UkWKnT/jDAwS XuzKKA3KABulEqqMzUvGPCvbgzdzEGF8BbzWm771khCIGhaHuwmWTQj1fUg/aS8qLq +E51xjytZlntwD6T7ZvfEHocZ/I40zrT+EYKJAd1/cDAoZ2+Ky8gNppX9nQQ/To6k2 Ff0Mung6kPU0j8yDTU3xIXRkZ78hdvmoZtGEBkzzOjuwVcpt8j0ZPwIdKlTvSmYYQ6 75vhfG/svmw0NBCish3QjmHVTxyIMCum/6bEHOcaKPGwT+dshVyWRW6E2FlhTni9YT GYF8R5lAKr/UQ== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 08 Jun 2024 16:34:54 +0200 X-ME-IP: 86.243.222.230 From: Christophe JAILLET To: jk@ozlabs.org, joel@jms.id.au, alistair@popple.id.au, eajames@linux.ibm.com, parthiban.veerasooran@microchip.com, christian.gromm@microchip.com, willy@infradead.org, akpm@linux-foundation.org Subject: [PATCH RESEND 3/3] proc: Remove usage of the deprecated ida_simple_xx() API Date: Sat, 8 Jun 2024 16:34:20 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: linux-fsi@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fsdevel@vger.kernel.org, Christophe JAILLET , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsi@lists.ozlabs.org Errors-To: linux-fsi-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "linux-fsi" ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_max() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET Reviewed-by: Matthew Wilcox (Oracle) --- This patch has been sent about 5 months ago [1] and has been A-by just a few minutes after. A gentle reminder has been sent 3 months later [2]. However, it has still not reached -next since then in the last 2 months. So, I've added the R-b tag and I'm adding Andrew Morton in To:, in order to help in the merge process. Thanks CJ [1]: https://lore.kernel.org/all/f235bd25763bd530ff5508084989f63e020c3606.1705341186.git.christophe.jaillet@wanadoo.fr/ [2]: https://lore.kernel.org/all/24c05525-05f7-48bb-bf74-945cf55d3477@wanadoo.fr/ --- fs/proc/generic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 775ce0bcf08c..c02f1e63f82d 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -202,8 +202,8 @@ int proc_alloc_inum(unsigned int *inum) { int i; - i = ida_simple_get(&proc_inum_ida, 0, UINT_MAX - PROC_DYNAMIC_FIRST + 1, - GFP_KERNEL); + i = ida_alloc_max(&proc_inum_ida, UINT_MAX - PROC_DYNAMIC_FIRST, + GFP_KERNEL); if (i < 0) return i; @@ -213,7 +213,7 @@ int proc_alloc_inum(unsigned int *inum) void proc_free_inum(unsigned int inum) { - ida_simple_remove(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST); + ida_free(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST); } static int proc_misc_d_revalidate(struct dentry *dentry, unsigned int flags)