Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2368377ioo; Sat, 28 May 2022 11:29:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8OLaOIeh9JdEVRbsC+JAiYMTgsXSH3UgHOi3JeNKI3hPhuGVU4YQWVo9hPqud2t8fGIRh X-Received: by 2002:a17:903:40d0:b0:163:62a5:3356 with SMTP id t16-20020a17090340d000b0016362a53356mr17334959pld.146.1653762551100; Sat, 28 May 2022 11:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653762551; cv=none; d=google.com; s=arc-20160816; b=zySrPF3q5BnljdCW2SWdnx7SaIHdebwoBW5UkyR3dymvPVSDb18aQXgmcUG73OMIfO BmXSY8j6TIXNOLBJN/oj9IceetpOdpFmxXiydSEMGksEJWrXW0oGfZXFNMYxZcAooAUA iZfFHCJLQfgGdpmXoUED4CHswuiw2SRd3RaG0NtcHKpIYvXiHpjgKiN8TPtN998POK9Z 8m5MZNO77x8FMoRbiPi1TwtA7J81TbZpjN+US5R5FsZwg0zoB+o0JP4Wa3jnQIinzidT uAQvHz5XgjguSQRqxRB171jgJ59pMRFeyRnoJEWgeAo/fOSSQQv/mKg6eVbhhrkFdsRX XF6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=vnAuJrAzwO+PuLcGWYDbuSMTaDytWlBDd6wHuqUZG3c=; b=c3CpnX5B9DCx4sPk8HlA3R8PHsH2aNj2MYFEtcGQi8LzaObCstwDFlZ3sVmCI81qQw 633vJ1ImhMxWzQUN1JDYJ8UDT1xNqKotszBpVGG1xeGGko92656W690A3pMWYVT/fBu4 p6ovPz+T4THjExFArwnNRBmlXLe5d+GhsfM0cpKGXSnrUsY1LLevaUgxE1ahxa46IOeY 3/6Jst6rMj91HVhdzb0NFIH+xW59blpHuaeelpEAKRQskqq08lUncltuPqNxE1Hr9omE rDBrJfUI0GiWPVNK0WCM2SINGKhxhQo6TE1y0kEsNT8J+9a9G1NXhGfj2/kMdty3Hiuq 9cpQ== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id jb4-20020a170903258400b0015ea7c9454bsi9036058plb.572.2022.05.28.11.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 11:29:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 415E719FB2; Sat, 28 May 2022 11:27:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245248AbiE0G0W (ORCPT + 99 others); Fri, 27 May 2022 02:26:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbiE0G0S (ORCPT ); Fri, 27 May 2022 02:26:18 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09B8630576; Thu, 26 May 2022 23:26:17 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L8ZXV2DPwz1JCRr; Fri, 27 May 2022 14:24:42 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 14:26:15 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500018.china.huawei.com (7.185.36.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 27 May 2022 14:26:14 +0800 From: keliu To: , , CC: keliu Subject: [PATCH] fs: eventfd: Directly use ida_alloc()/free() Date: Fri, 27 May 2022 06:47:43 +0000 Message-ID: <20220527064743.2358552-1-liuke94@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500018.china.huawei.com (7.185.36.111) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu --- fs/eventfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/eventfd.c b/fs/eventfd.c index 3627dd7d25db..e17a2ea53da9 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c @@ -89,7 +89,7 @@ EXPORT_SYMBOL_GPL(eventfd_signal); static void eventfd_free_ctx(struct eventfd_ctx *ctx) { if (ctx->id >= 0) - ida_simple_remove(&eventfd_ida, ctx->id); + ida_free(&eventfd_ida, ctx->id); kfree(ctx); } @@ -423,7 +423,7 @@ static int do_eventfd(unsigned int count, int flags) init_waitqueue_head(&ctx->wqh); ctx->count = count; ctx->flags = flags; - ctx->id = ida_simple_get(&eventfd_ida, 0, 0, GFP_KERNEL); + ctx->id = ida_alloc(&eventfd_ida, GFP_KERNEL); flags &= EFD_SHARED_FCNTL_FLAGS; flags |= O_RDWR; -- 2.25.1