Message ID | 575dcecd51097dd30c5515f9f0ed92076b4ef403.1702229520.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6623152vqy; Sun, 10 Dec 2023 09:32:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+8mrM0puO6QmTLXF/Hn+5ILfOH+Z25UOTH4cSN+yqZ0RUZjmB214A5iODkdZ0oPKDShe5 X-Received: by 2002:a05:6a20:7d89:b0:190:4b78:99b1 with SMTP id v9-20020a056a207d8900b001904b7899b1mr4243332pzj.42.1702229550011; Sun, 10 Dec 2023 09:32:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702229549; cv=none; d=google.com; s=arc-20160816; b=trYtfibPqlQ7MCL1fIpDvFNSxPHVK+wxj1dWT3iqrVSbgC8gKCdYAdc1FfzMqHnjOb 1/diT/t0MTRa9nymc9DuK3kcq0YSg7gCv7hAq/La0FZfJH0zsAcf0zji6OVU57f7g7E8 Y5Rxndc/Y1sSz4UFayMdXyI0Xfj2+WU17IVhzRP/r5IX0BGF3ixLrwog7TGDpzu2xvsO I1A9hFAT7dSvozYbcES+y4+vBR6UK8NsZlBFx8Np5X0+oPbNVQR90Gl0U/cfLSAPbFeq clLG2zBsr2vB7uOWmy0kVnEvOfriFSPA7sl0JGE0zThHESXvvTXp1xZ6otp4o2L1/jf+ Yppg== 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:dkim-signature; bh=7R7swsMSVHfAzgaVMpMek+u6m1tMZkWO2VT0rabXWAg=; fh=TO85W+MECx2yk/kFcLO4zwHjgtLS5vIk56JfdgTquNM=; b=a0V2XMuDWIHN8YO37pcOf5kNbo8Dk6azQ6rdjta3emlQ6nVJvY2CrBUw0XIypyaISU a4lVhB/GSmabP9FPE2IcI7C4P9mo3p+jEL8Jd2e2rb+QYlbsxOz0xLADY2ejYmjUcA/n RxFcsNWINWuhgTFTodPWmm0VQHantR9WuuidXtGOWTEmcCPaC8pBBwYavCc69Q/oRAqE 94ICaGsckqAQ0xMEuNHGSH/LRqIuNXt3Md3YYxF5js59J/UOyGEjDRUW4S30hBMeTnhY dbipi5UicSO5DqWiYdstoLw0gCm7BWp0gWCEyl1xuoc1COZoM4/A+Jr9G4BMBvIVrAcF +CGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="ae4o7v/M"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j25-20020a632319000000b005b8f24e6525si4694528pgj.81.2023.12.10.09.32.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 09:32:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="ae4o7v/M"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B6141807387F; Sun, 10 Dec 2023 09:32:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231932AbjLJRcR (ORCPT <rfc822;rua109.linux@gmail.com> + 99 others); Sun, 10 Dec 2023 12:32:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231861AbjLJRcQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 10 Dec 2023 12:32:16 -0500 Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D61C2106 for <linux-kernel@vger.kernel.org>; Sun, 10 Dec 2023 09:32:22 -0800 (PST) Received: from pop-os.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id CNfArZE5YMO0QCNfArYiy3; Sun, 10 Dec 2023 18:32:21 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1702229541; bh=7R7swsMSVHfAzgaVMpMek+u6m1tMZkWO2VT0rabXWAg=; h=From:To:Cc:Subject:Date; b=ae4o7v/MuPampl5degm+HCMI8B3Q9AJOxB0cLwF+02eFNh3cGN6E/yK0yk8qorsVS 5n1FzNxiqP9Xy37TozLxocH4ry3B4R0ro3DpLtZQuNGbJHpxGzkUMSMJYM2/V+ixVW sWvxJNPdjuGMVvoF6/GiKgnG7j6jLSqo2uDNiLiJ4O6DBWAqQn4tbXHgWMTdWntZKY bxsYpx9Iey7sfoa8q2e6z7q0k0zdGBMOVrsNy3XDbOoQu32013IjbGMZG0YZ0ocNup bUux/Wl5JUJfbUwCYJl8r83RDDA0gxmhVsMwtdtTHihaJBvX/nhbPLXoyepiTkW5/G qg/Hi8SfyuI+w== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 10 Dec 2023 18:32:21 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, linux-fsdevel@vger.kernel.org Subject: [PATCH] eventfd: Remove usage of the deprecated ida_simple_xx() API Date: Sun, 10 Dec 2023 18:32:18 +0100 Message-Id: <575dcecd51097dd30c5515f9f0ed92076b4ef403.1702229520.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 10 Dec 2023 09:32:26 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784917052183213083 X-GMAIL-MSGID: 1784917052183213083 |
Series |
eventfd: Remove usage of the deprecated ida_simple_xx() API
|
|
Commit Message
Christophe JAILLET
Dec. 10, 2023, 5:32 p.m. UTC
ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().
This is less verbose.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
fs/eventfd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Sun, 10 Dec 2023 18:32:18 +0100, Christophe JAILLET wrote: > ida_alloc() and ida_free() should be preferred to the deprecated > ida_simple_get() and ida_simple_remove(). > > This is less verbose. > > Applied to the vfs.misc branch of the vfs/vfs.git tree. Patches in the vfs.misc branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.misc [1/1] eventfd: Remove usage of the deprecated ida_simple_xx() API https://git.kernel.org/vfs/vfs/c/ece491e762cc
On Sun 10-12-23 18:32:18, Christophe JAILLET wrote: > ida_alloc() and ida_free() should be preferred to the deprecated > ida_simple_get() and ida_simple_remove(). > > This is less verbose. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Looks good. Feel free to add: Reviewed-by: Jan Kara <jack@suse.cz> Honza > --- > fs/eventfd.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/eventfd.c b/fs/eventfd.c > index 16bea05a7c78..ad8186d47ba7 100644 > --- a/fs/eventfd.c > +++ b/fs/eventfd.c > @@ -82,7 +82,7 @@ EXPORT_SYMBOL_GPL(eventfd_signal_mask); > 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); > } > > @@ -395,7 +395,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.34.1 >
diff --git a/fs/eventfd.c b/fs/eventfd.c index 16bea05a7c78..ad8186d47ba7 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c @@ -82,7 +82,7 @@ EXPORT_SYMBOL_GPL(eventfd_signal_mask); 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); } @@ -395,7 +395,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;