Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp408959rdb; Thu, 30 Nov 2023 07:56:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFMONUDI930jw3yaBH0WCxgevfRiJB/Y2kOdZlmhWmfqACsoVrd2wKLygWq5IMLWy6rJIQ X-Received: by 2002:a05:6a20:13c8:b0:187:6dd3:946c with SMTP id ho8-20020a056a2013c800b001876dd3946cmr18492226pzc.61.1701359795865; Thu, 30 Nov 2023 07:56:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701359795; cv=none; d=google.com; s=arc-20160816; b=mBHm+srMHbtpEbCoxgh9DbGy1J0tCd5mgKK8N+qR9NtB2bLswe+CUlQtAJPLMHBHX6 wxHKi92TwE64tdxHIPs5JtQbtvDBAtBiruUf1lVxd6yOCDFzT7T5i/mC8YGAcYDS8NGR s6gYGbDKeEc/SpYy9BWmSPa88mcju+ZPwTLOTKJ03Y1AUGnLj/kjuXKpoZk9CFNuRb3Y kMQVv/8jqRHP5UWVyv4TRmcAWSehsv4r0iqiHwqYC9jC5Klmd4S4C7+y2CEu6lerAZhW no8b+d54D1zA+aKrH/RyoLJN3LocK017yef+S6vhrcyqZk7BdG5XadaKb3vV6Stju/K3 Lg8g== 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=n3UI3NRuxoW+PspfZfzEFywX+JtF3nvhyZQ2A/+zOgg=; fh=zk555a+j0ZyvYnk/5NTpSEx/rtSSux28WPhBgwt72Zo=; b=ywjEL3yP1Vu85KKdAcIdtZOQU3oaz20cyslX4Gm/yHsHun1bGQojWiBaoxdB1Fhgxa e0B5locNTdmt2Fu5296WaHu91p6ZlWiJknw0ZJJxDaG8NsM8A3IkNsgtPYgs+TZv0hMX DTaV8pKOkWjRcXM4IBL977ZuhO0+uSpWbpwrbnNxttg/xy5Xu7T3I9SNmcjnY1YaCe+b BwrhjoLZI79Eti/u7e/VoyZnzyo3XRNy/ssCy415hn+/de5keQzOKAU0n1oVo5poHSIa +WVO/GVvS90gJXuQeZFlCnJE5dVCjyvQJ6Wd+ui4YWtprQ/RLz0P0TNqcszjvVYpjdOV YUpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1xfiPH0v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id de12-20020a056a00468c00b006cddb04ab75si1406901pfb.53.2023.11.30.07.56.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 07:56:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1xfiPH0v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id A89C08022A88; Thu, 30 Nov 2023 07:56:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346425AbjK3P4M (ORCPT + 99 others); Thu, 30 Nov 2023 10:56:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346411AbjK3P4L (ORCPT ); Thu, 30 Nov 2023 10:56:11 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B55910D0 for ; Thu, 30 Nov 2023 07:56:17 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B66DDC433C7; Thu, 30 Nov 2023 15:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1701359777; bh=Atqz2R8S5CFNofHmkfbPck2yrnj1PJGSJBWuitp3Lps=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1xfiPH0vRvQNxh0H18ebsiz+QfXIO8h49qtn0BttXKyyJSgU0KjgGqV7EineszNcM YfXWi3JxZnBYtdyoZLPf+lHo4BaXOhVIFSsRS6ZLrN4JIawZIMxnELgiDZvOoDIXKG IS9mpPQxycqq6pikqdDmy03gNorSUfMJRnf9Zav0= Date: Thu, 30 Nov 2023 15:56:14 +0000 From: Greg Kroah-Hartman To: Benno Lossin Cc: Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Andreas Hindborg , Peter Zijlstra , Alexander Viro , Christian Brauner , 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 1/7] rust: file: add Rust abstraction for `struct file` Message-ID: <2023113010-situated-brunch-d52d@gregkh> References: <20231129-alice-file-v1-0-f81afe8c7261@google.com> <20231129-alice-file-v1-1-f81afe8c7261@google.com> <2023113041-bring-vagrancy-a417@gregkh> <2gTL0hxPpSCcVa7uvDLOLcjqd_sgtacZ_6XWaEANBH9Gnz72M1JDmjcWNO9Z7UbIeWNoNqx8y-lb3MAq75pEXL6EQEIED0XLxuHvqaQ9K-g=@proton.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2gTL0hxPpSCcVa7uvDLOLcjqd_sgtacZ_6XWaEANBH9Gnz72M1JDmjcWNO9Z7UbIeWNoNqx8y-lb3MAq75pEXL6EQEIED0XLxuHvqaQ9K-g=@proton.me> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 30 Nov 2023 07:56:32 -0800 (PST) On Thu, Nov 30, 2023 at 03:46:55PM +0000, Benno Lossin wrote: > 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 = bindings::O_APPEND; > >> > >> Why do all of these constants begin with `O_`? > > > > 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? Because this is a unix-like system, we all "know" what they mean. :) See 'man 2 open' for details. > In Rust we have namespacing, so we generally drop common prefixes. Fine, but we know what this namespace is, please don't override it to be something else. thanks, greg k-h