From nobody Thu Apr 2 11:43:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9FEAC6FA82 for ; Mon, 26 Sep 2022 01:26:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233088AbiIZB0r (ORCPT ); Sun, 25 Sep 2022 21:26:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232951AbiIZB0p (ORCPT ); Sun, 25 Sep 2022 21:26:45 -0400 Received: from unicom145.biz-email.net (unicom145.biz-email.net [210.51.26.145]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3EFA28701 for ; Sun, 25 Sep 2022 18:26:42 -0700 (PDT) Received: from ([60.208.111.195]) by unicom145.biz-email.net ((D)) with ASMTP (SSL) id UAA00139; Mon, 26 Sep 2022 09:26:39 +0800 Received: from localhost.localdomain (10.200.104.97) by jtjnmail201612.home.langchao.com (10.100.2.12) with Microsoft SMTP Server id 15.1.2507.12; Mon, 26 Sep 2022 09:26:38 +0800 From: Bo Liu To: , , CC: , , Bo Liu Subject: [PATCH] dax: Remove usage of the deprecated ida_simple_xxx API Date: Sun, 25 Sep 2022 21:26:35 -0400 Message-ID: <20220926012635.3205-1-liubo03@inspur.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 X-Originating-IP: [10.200.104.97] tUid: 20229260926398113c515f49a2a58b7974007982becac X-Abuse-Reports-To: service@corp-email.com Abuse-Reports-To: service@corp-email.com X-Complaints-To: service@corp-email.com X-Report-Abuse-To: service@corp-email.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use ida_alloc_xxx()/ida_free() instead of ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Signed-off-by: Bo Liu Reviewed-by: Ira Weiny --- drivers/dax/super.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 9b5e2a5eb0ae..da4438f3188c 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -363,7 +363,7 @@ static void dax_free_inode(struct inode *inode) { struct dax_device *dax_dev =3D to_dax_dev(inode); if (inode->i_rdev) - ida_simple_remove(&dax_minor_ida, iminor(inode)); + ida_free(&dax_minor_ida, iminor(inode)); kmem_cache_free(dax_cache, dax_dev); } =20 @@ -445,7 +445,7 @@ struct dax_device *alloc_dax(void *private, const struc= t dax_operations *ops) if (WARN_ON_ONCE(ops && !ops->zero_page_range)) return ERR_PTR(-EINVAL); =20 - minor =3D ida_simple_get(&dax_minor_ida, 0, MINORMASK+1, GFP_KERNEL); + minor =3D ida_alloc_max(&dax_minor_ida, MINORMASK, GFP_KERNEL); if (minor < 0) return ERR_PTR(-ENOMEM); =20 @@ -459,7 +459,7 @@ struct dax_device *alloc_dax(void *private, const struc= t dax_operations *ops) return dax_dev; =20 err_dev: - ida_simple_remove(&dax_minor_ida, minor); + ida_free(&dax_minor_ida, minor); return ERR_PTR(-ENOMEM); } EXPORT_SYMBOL_GPL(alloc_dax); --=20 2.27.0