Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp402398rdb; Thu, 30 Nov 2023 07:47:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJsl0nZBqpWcpfXjUITJwb0OI6mRn+d34T+BFTcLv2Uwc+7z3DoWhmD1yLmsXptDcMniGc X-Received: by 2002:a17:902:ea8a:b0:1cf:c35d:12fc with SMTP id x10-20020a170902ea8a00b001cfc35d12fcmr21735991plb.19.1701359248675; Thu, 30 Nov 2023 07:47:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701359248; cv=none; d=google.com; s=arc-20160816; b=MUg7El+htzXKplVn8sfkV9VF5gTY5uzLQN+U57KkaLV5MoXQfIoNq51IZzEc4Hnv6J h8CvzZRRIIcjxAtnFGqy7Q0Kl6ogUn9loM1pAgHvF+6jFwnm+GPIx/Fw0B8sPleURjAs GnfwcgcOoocC3A5HNGo+PI87yeZXUwyoTMSVYliHT7Its7MQwADICk1re0vtqttSl+Ur j8Zl/CWtqFLehiEyWXG4+FZ2K/h1a87FxHKfN1yy3dbxB8YSKkGdZhwiKduj+zpWt0ak XnV/lnRTy/FycxDW5rrToq/GcrGDf7tJgoYq2rL6RRrXVT7VJum8LMn6vDd6JNA6dgry ZyxA== 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 :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :date:dkim-signature; bh=cEvdKECLsg9a2eLWYuxUSspqEsF3BY9+NgXdkgl9pLA=; fh=c3NZY4kfRIazqVVxm/sIauDwv/U8tuC5+pdBe4phih4=; b=uJ7ucVhnN37WpaEZLdLaqKcZA+1KvFJfAzoAwrHdNI9Vi+SFJbjH+Ywzm4AWZ9CBXq Yds6PvHVArdAx/8MS2EPNpBFMqmjxUrMtHUYmC4XQkSQAOH5mwCfxu4QI9yBk/mksdZA DDfeO/eIsY9jnYOJiiEVpG5KzlA/h0Kh8Tsfs60SmkrF2Hzqai0ZbCQkhesVRY83nduQ kBxPFzwGaQfvzVGaqe6tv2XU4hR4YRxx6WyZ0M7C84tg+8bvtJYWXUkTJo0udyOUjxCg OW8+y46dj4MB44QU+MhFam3YqjE5GO/QofIsbb2R0rBlqogG1hxYpiIsPMzJomEIECdP XGsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=Fq856kW6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id nv15-20020a17090b1b4f00b002841a9ca614si1665199pjb.187.2023.11.30.07.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:47:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=Fq856kW6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 34E3E802E8AA; Thu, 30 Nov 2023 07:47:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346312AbjK3PrG (ORCPT + 99 others); Thu, 30 Nov 2023 10:47:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232208AbjK3PrF (ORCPT ); Thu, 30 Nov 2023 10:47:05 -0500 Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29A4110E6 for ; Thu, 30 Nov 2023 07:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1701359229; x=1701618429; bh=cEvdKECLsg9a2eLWYuxUSspqEsF3BY9+NgXdkgl9pLA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Fq856kW64t+MOtZ9Ri2JEdAgatjjoQSLmYDevIA3Kcr7RHttrKN4KbdCnbI9PusHJ rwtQHx187GizzkFthkPho86Be0FHErw0oRWfivHdt55oypqmOy3Vv/BhzEiUIyMqD+ aUy7/X5YKAMNwD3j+31Gl4UZSSr3m1IU8J2JQaeGcAE0P7bWJ57bXlm/V/cofOl7F5 O2nhxEx9Q38GQaDffOZbXGoeNZhnIpSkz31NsFCMhC4faMKuUAgKBQFGYfzMWK/wMb VUkmLOkkeW7ebZcomEoR8Ho6MNXhze1jkG+Z4tl6lssBaugVSYQTdAV/Z2ptY8jy7k IpPHjB3xADRAA== Date: Thu, 30 Nov 2023 15:46:55 +0000 To: Greg Kroah-Hartman From: Benno Lossin Cc: Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Peter Zijlstra , Alexander Viro , Christian Brauner , =?utf-8?Q?Arve_Hj=C3=B8nnev=C3=A5g?= , 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 1/7] rust: file: add Rust abstraction for `struct file` Message-ID: <2gTL0hxPpSCcVa7uvDLOLcjqd_sgtacZ_6XWaEANBH9Gnz72M1JDmjcWNO9Z7UbIeWNoNqx8y-lb3MAq75pEXL6EQEIED0XLxuHvqaQ9K-g=@proton.me> In-Reply-To: <2023113041-bring-vagrancy-a417@gregkh> References: <20231129-alice-file-v1-0-f81afe8c7261@google.com> <20231129-alice-file-v1-1-f81afe8c7261@google.com> <2023113041-bring-vagrancy-a417@gregkh> Feedback-ID: 71780778:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 fry.vger.email 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 (fry.vger.email [0.0.0.0]); Thu, 30 Nov 2023 07:47:26 -0800 (PST) On 11/30/23 15:59, Greg Kroah-Hartman wrote: > On Thu, Nov 30, 2023 at 02:53:35PM +0000, Benno Lossin wrote: >> On 11/29/23 13:51, Alice Ryhl wrote: >>> +/// Flags associated with a [`File`]. >>> +pub mod flags { >>> + /// File is opened in append mode. >>> + pub const O_APPEND: u32 =3D bindings::O_APPEND; >> >> Why do all of these constants begin with `O_`? >=20 > Because that is how they are defined in the kernel in the C code. Why > would they not be the same here? Then why does the C side name them that way? Is it because `O_*` is supposed to mean something, or is it done due to namespacing? In Rust we have namespacing, so we generally drop common prefixes. --=20 Cheers, Benno