Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp277022rdb; Thu, 30 Nov 2023 04:46:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHB8EHIZFgDIxOPFizEFHzP2eGyQzKlHZSg7pZEShXQLNPTBy9Wm8e3e+5pSWAKker7QSda X-Received: by 2002:a05:6a21:980d:b0:18c:4fcc:c7e2 with SMTP id ue13-20020a056a21980d00b0018c4fccc7e2mr13441334pzb.23.1701348410889; Thu, 30 Nov 2023 04:46:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701348410; cv=none; d=google.com; s=arc-20160816; b=SdzeqT3IREHZ7NTzg3dVJLg/yaCZJY1C3YwbsVOZ1eCOApzZOK2qNJon/gVlX0y7it zMV9EtIXH3HYbYklpPZaQPFrN+xLY87rrne0g38bSQqW20NWvkyussuUZ5CmcbRxamFX etJwNr7atLUD7RGDfPlrNuFeSzrEJi6OoSq5V/BSwsBNHJPn7PVPeolRI36l6zu4vBiJ ZR5NHWTpjC+f6kMbXEfrSYSLNxE3hRjNQRpHKyiEfTz4sescgdbQGp1QApqltmDUqOTQ H6JhKRxhhHbeO4jPsfePGtPrGC10RBKIAZyJXGpfITapyvAsw4XAEiRwhRgv8YtJWFCa AdUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fl56Fdglxmi8I0PIT0yASMJnXltEfKb25fH0ye948TI=; fh=ofhc6+W786VzDoDdXle+5/U4CWK2vxLUT6zNfsjNsWg=; b=08u8HauzafTpyItiwobU5+Vr7Ye4vQxqWMNEbIDvkM6zbQOWSDXSr9ZRQzPXGjXGuV h74WK3uwACGcA1toTPEY4W4xuhd5D3pipYm4x2sPqkxw1cZkoHQdk0vShgPdpAXOdgbR 8BiueQjFHLfYhBYz1mq8JNy4b2NumklpRUQlkj8t8Sz98GV01Q5sMtYgsK4TKwOIQQDV qFj60EIjxkaboe89qWb5H9qWH2Gbzyvs92Vwtm0LeiVENowCxUXHW4sHFN8HmE3tP3Q6 Gv93pxFXAN2XslT098lGCeHCww6C/rVxzQysxowhQ1wTbvugWiDnazquHvMm0BnYbUyo 1n1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QqekIxo6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y25-20020a631819000000b005b8f0ca2e5asi1250709pgl.79.2023.11.30.04.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 04:46:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QqekIxo6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6075A805A78D; Thu, 30 Nov 2023 04:46:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232005AbjK3Mqk (ORCPT + 99 others); Thu, 30 Nov 2023 07:46:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231970AbjK3Mqi (ORCPT ); Thu, 30 Nov 2023 07:46:38 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81932D50 for ; Thu, 30 Nov 2023 04:46:45 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 607AAC433C8; Thu, 30 Nov 2023 12:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701348405; bh=Turv8447m0iSBp/1OD7/8HA4BfAu143dTXX+sHwM0FQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QqekIxo6sLR+ZJAdumnjYlqU2xkYUbQi9E5yxc7xwxXoiHS8WTSoDX0k4CjTjTNrR mBpKj8soTxt0h5dT2M1MGA24pCTg3NAesXV4tzAC9rhTph2SKpsKTbwyGUr5AGKDt0 BKmvPGyXA1E1rXsB0Z63r3ja5QnXla6gxH+w2XWJA/IZGsFVlUrcKe1XXdzwkbV39B JO9RtBINtp9hZHoTwT3yS/3fbPClifFhi6JVfwLdzwOFWnQJOaz7pFJhZQs5tGLxq1 YQOCR3pEWHtg3zf9Nrm8ATXKwUppSWBHxpCnrNUtsCElu0jKG+SGXVteOhAYrDjsf5 ZjTutNZycpi8w== Date: Thu, 30 Nov 2023 13:46:36 +0100 From: Christian Brauner To: Peter Zijlstra Cc: Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?B?QmrDtnJu?= Roy Baron , Benno Lossin , Andreas Hindborg , Alexander Viro , Greg Kroah-Hartman , Arve =?utf-8?B?SGrDuG5uZXbDpWc=?= , 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: <20231130-wohle-einfuhr-1708e9c3e596@brauner> References: <20231129-alice-file-v1-0-f81afe8c7261@google.com> <20231129-alice-file-v1-5-f81afe8c7261@google.com> <20231129-etappen-knapp-08e2e3af539f@brauner> <20231129164815.GI23596@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231129164815.GI23596@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 30 Nov 2023 04:46:49 -0800 (PST) On Wed, Nov 29, 2023 at 05:48:15PM +0100, Peter Zijlstra wrote: > 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. The problem is that we end up with a long list of explicit exports that also are all really weirdly named like rust_helper_*(). I wouldn't even complain if it they were somehow auto-generated but as you say that might be out of scope. The thing is though that if I want to change the static inlines I know also have to very likely care about these explicit Rust wrappers which seems less than ideal. So if we could not do rust_helper_*() exports we'd probably be better off.