From mboxrd@z Thu Jan 1 00:00:00 1970 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 3EAA7C4167B for ; Wed, 29 Nov 2023 16:49:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbjK2Qsw (ORCPT ); Wed, 29 Nov 2023 11:48:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230324AbjK2Qst (ORCPT ); Wed, 29 Nov 2023 11:48:49 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C80AB6; Wed, 29 Nov 2023 08:48:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tiPBXf1kZm2l8+7WRSaX1GLajBl09o/Tkot6Kx1Gxo0=; b=o9BTJ3na+CayHjCSRZpl2hxliT eZWFH3ECXx+oJ7DlR9ag0VtHn0Z2tXkZTZiOvVe7bHtsuQ2Zk9r/lDdgnScTBopq4dC6DPa2dPJLe GESlCC6PcoctemBjNadjUc3b0BfqJynYCAP/nZ2+XcPvqv/AXjCMh8rDWbqRguQroRYlEihFRLapB WN7LI1bGNDmTpb6vOAozO/72c90oKSQmni3CfkKhnCbzWDdaoenV2KOOJIPzsP5kG6gXPdkT7oHQk N4a3SxtqtYwrH4xc8IqSk38EGJBCMQEF9RsKJuWJSCttRemeHKUGu9TW6jqf3w3QQiY15NlTOpSVL TMUlR9wg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1r8NjU-000QPZ-1K; Wed, 29 Nov 2023 16:48:20 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 2EE9E30017D; Wed, 29 Nov 2023 17:48:15 +0100 (CET) Date: Wed, 29 Nov 2023 17:48:15 +0100 From: Peter Zijlstra To: Christian Brauner Cc: Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alexander Viro , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , Dan Williams , Kees Cook , Matthew Wilcox , Thomas Gleixner , Daniel Xu , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 5/7] rust: file: add `Kuid` wrapper Message-ID: <20231129164815.GI23596@noisy.programming.kicks-ass.net> References: <20231129-alice-file-v1-0-f81afe8c7261@google.com> <20231129-alice-file-v1-5-f81afe8c7261@google.com> <20231129-etappen-knapp-08e2e3af539f@brauner> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231129-etappen-knapp-08e2e3af539f@brauner> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 29, 2023 at 05:28:27PM +0100, Christian Brauner wrote: > > +pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk, > > + struct pid_namespace *ns) > > +{ > > + return task_tgid_nr_ns(tsk, ns); > > +} > > +EXPORT_SYMBOL_GPL(rust_helper_task_tgid_nr_ns); > > I'm a bit puzzled by all these rust_helper_*() calls. Can you explain > why they are needed? Because they are/can be static inlines and that > somehow doesn't work? Correct, because Rust can only talk to C ABI, it cannot use C headers. Bindgen would need to translate the full C headers into valid Rust for that to work. I really think the Rust peoples should spend more effort on that, because you are quite right, all this wrappery is tedious at best.