Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp2152rdb; Mon, 15 Jan 2024 09:54:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGzesq/0oDvzJ6wlHT6qDuTqa2EvInDpJAiG5Nj+Ww6YuHCnGy6dQhrchEjpPXrET3SjXJ X-Received: by 2002:a05:622a:1a87:b0:429:e741:6087 with SMTP id s7-20020a05622a1a8700b00429e7416087mr3629708qtc.9.1705341246868; Mon, 15 Jan 2024 09:54:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705341246; cv=none; d=google.com; s=arc-20160816; b=j3goGge7mWQO9+yMbyD2J13WcaGQSG0DL9edIm7AhWo0Q/RmI7GfmNd1hFTr41qRmf N9/05uPH4IFTHZNNaV4KJxkcc0efR7Em7589nrhNdyhgpzDm2bi8g5Macr0I7zFWMQBN K8DCTPuxJmwSAbjNC7rqAzUQUKCfynvO/ua0duLoDmMNGdybsbLyD81ttupBF2gaE+8S uHGhEMnO6MIEMcZAsiZZlr3vw5/EkVhwq6eXLTMag86L7OJe45u2vRHoJjJmVJBjANul 3ZFS5Rlu1SMnh09y+0OgqKsFehE3IxXCLVlZ6x74U5AxGn3dgUu/pvCAkdRB/z4PW2Ji iKcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=YQ342wzKG8l+HvEf+kwqJXG/SRijPi9FKSwNRrk06AQ=; fh=c5ZDRFZSUn94KHOGgBN75btks+6QmER45O8XXjkZOIA=; b=PY7QP3iKuXqieyhm5mhe23oO2TOjAWP5AGI4gbkCVBNtOUBv79mg7VJ0QWMVLx9zee H6b92P/3bHkLEWZNk4QE0g4WQV8OTmtG6Vg/iitbcXgYoxYge41N2PgVGQY6ZQhCXGo2 9AFHfTyGvT9T7oFjerSH6caQCbok8v4tBsNyfz+C4ZOP1FO7wYjjTHpdyWdXkEXEIdNv JV3yuz8HH5jJdYP3QwWLxKEEYSbqAjUztV2j9fEoTrzjKT0FyeptUxVQaqFi2UuKJUSZ v2qU2oQnCWIBiwq0GmQQ5/kAYal+6iP6xBR+izX65OlxxLVHMZwlM9MLVR/kGRyVEGs0 KQZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=OPEg1FsT; spf=pass (google.com: domain of linux-kernel+bounces-26329-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26329-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c8-20020a05622a058800b00429b91ea4e5si8351642qtb.458.2024.01.15.09.54.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 09:54:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26329-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=OPEg1FsT; spf=pass (google.com: domain of linux-kernel+bounces-26329-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26329-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9A8FE1C21D93 for ; Mon, 15 Jan 2024 17:54:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F5BD182B3; Mon, 15 Jan 2024 17:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="OPEg1FsT" Received: from smtp.smtpout.orange.fr (smtp-19.smtpout.orange.fr [80.12.242.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2835718040 for ; Mon, 15 Jan 2024 17:53:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from fedora.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id PR9Xr0TyYx8edPR9Xryrz3; Mon, 15 Jan 2024 18:53:43 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1705341223; bh=YQ342wzKG8l+HvEf+kwqJXG/SRijPi9FKSwNRrk06AQ=; h=From:To:Cc:Subject:Date; b=OPEg1FsTJjzZGTiT1H6UWm7uJzM+eOAIJVSnhT9wY+QhMSg6uv9EFGHOW5g5EsPc2 eSFbY4YFUv/zgOJyNDV6d50kRAbA1lEMr2r+QsLgYUCL6Ou3jZYmLI+OPrZtQw7emZ QG4oV1vSEFN2A5FhQsCjF+eNK/30biNwKSOevKYdI2f3IcF7UIHPrBSDVywARfopC1 mJTcnV6wRiCnTrFOL9FuWhvtwq9qicA/6pqcosV80fm/4cnON4oEPzSOZ9Xom0aiWa eq2+yZENB+yQ7b+3wfVMN20bjKi0cvp5bEUScvjliGMkVgKrE8JZDLVaQzxXwVWGav IsHMoBV32/++Q== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 15 Jan 2024 18:53:43 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-fsdevel@vger.kernel.org Subject: [PATCH] proc: Remove usage of the deprecated ida_simple_xx() API Date: Mon, 15 Jan 2024 18:53:37 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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) -- 2.43.0