Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp227614rwb; Sun, 25 Sep 2022 19:20:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5H2YhyHT7G2qWAA0PkSMmTQqrEjR43SamTLB8sGYumcfKwiIyjTVVI4AcFFpWwXqNZ9aRK X-Received: by 2002:a17:907:a40e:b0:783:4d41:a159 with SMTP id sg14-20020a170907a40e00b007834d41a159mr3989527ejc.212.1664158855297; Sun, 25 Sep 2022 19:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664158855; cv=none; d=google.com; s=arc-20160816; b=pdtvoNGK7MVPVsScGqXj43lXlIYaaSA2nTl5tEwKMv4ZmQ3p/WHrsRfOSkcwwfDdvo SDtn+K6q2+PfniggziTtJWTRZEfFmFOP03tOGLLB9jJT2johebEpMhQWdMK04KpNOrSD orayUdQyIk3O+tm4TWl1i5hpHF1zp9IkSiFr0VvnTKN5iYiclnujTN5GTIOHlkZ3tXjE SAGF6VaXo449iAlQk0Q87sllcW3v/JYppsbpjGfhqBz6Jn+g3Ax5fmrRK0B0hdRw2yF5 J1eqffubY5xpXBWvEDl5ehqdGM4eIvhmDujVyi+x5bk5LVlO7R01cePKN519JiAi5aZj vgKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:abuse-reports-to:tuid:mime-version:message-id :date:subject:cc:to:from; bh=YZFCNI9ZMsvvCLcvCMESK9cFpQgG2LdGxHHDRlgrWtg=; b=PMCqWJkpxjbXEx88WFeYWEd9su7zm/0cj+uomgUY7AMzFRwzRIRsW+xOElHjsWTkdV e13JxFEYNL+Y3w1TDdLVScJ+QE+9UwHopNimKS3EzjosPKZvpeEOXTGIYbstTfO9aeqC 71ogUJYwNS5lICBszWlQ1VGlyneXZm5smQYGIoZOjFNQyvDhWX9Om5yUnbq7Q0IJomGH ozkdln0FGpXrXWbHySHp2pj+oJuLiNlsb8dqTNatyMtQZWG85Xs1gAc05Sze6/zWB6/H MgiHnISn33+G75uOb9GBYJ3d2RCYBH0bQ1BFwqluUMO4KnVd5rQmN6eCK0HLuN/bESSq 49Mw== 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 nd16-20020a170907629000b0078200f94d06si20190634ejc.237.2022.09.25.19.20.28; Sun, 25 Sep 2022 19:20:55 -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 S233038AbiIZB0q (ORCPT + 99 others); Sun, 25 Sep 2022 21:26:46 -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 Content-Type: text/plain 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 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS 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 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 --- 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 = 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); } @@ -445,7 +445,7 @@ struct dax_device *alloc_dax(void *private, const struct dax_operations *ops) if (WARN_ON_ONCE(ops && !ops->zero_page_range)) return ERR_PTR(-EINVAL); - minor = ida_simple_get(&dax_minor_ida, 0, MINORMASK+1, GFP_KERNEL); + minor = ida_alloc_max(&dax_minor_ida, MINORMASK, GFP_KERNEL); if (minor < 0) return ERR_PTR(-ENOMEM); @@ -459,7 +459,7 @@ struct dax_device *alloc_dax(void *private, const struct dax_operations *ops) return dax_dev; err_dev: - ida_simple_remove(&dax_minor_ida, minor); + ida_free(&dax_minor_ida, minor); return ERR_PTR(-ENOMEM); } EXPORT_SYMBOL_GPL(alloc_dax); -- 2.27.0