From: "Danilo Krummrich" <dakr@kernel.org>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>
Cc: <gregkh@linuxfoundation.org>, <rafael@kernel.org>,
<ojeda@kernel.org>, <alex.gaynor@gmail.com>,
<boqun.feng@gmail.com>, <gary@garyguo.net>,
<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
<a.hindborg@kernel.org>, <aliceryhl@google.com>,
<tmgross@umich.edu>, <mmaurer@google.com>,
<rust-for-linux@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Christian Brauner" <brauner@kernel.org>,
"Jan Kara" <jack@suse.cz>
Subject: Re: [PATCH v2 1/8] rust: fs: add file::Offset type alias
Date: Tue, 21 Oct 2025 19:34:12 +0200 [thread overview]
Message-ID: <DDO6IUEAVBR0.14AZ0UXFYQF48@kernel.org> (raw)
In-Reply-To: <CANiq72=N+--1bhg+nSTDhvx3mFDcvppXo9Jxa__OPQRiSgEo2w@mail.gmail.com>
On Tue Oct 21, 2025 at 6:47 PM CEST, Miguel Ojeda wrote:
> If it is just e.g. add/sub and a few from/into, then it sounds ideal
> (i.e. I am worried if it wants to be used as essentially a primitive,
> in which case I agree it would need to be automated to some degree).
That's what I need for this patch series, I think the operations applicable for
this type are quite some more; not that far from a primitive.
> To me, part of that is restricting what can be done with the type to
> prevent mistakes.
>
> i.e. a type alias is essentially the wild west, and this kind of
> type/concept is common enough that it sounds a good idea to pay the
> price to provide a proper type for it.
The reason why I said for this case I think it would be good to have derive
macros first is that there's a lot of things that are valid to do with an offset
value.
Of course, there's also a lot of things that don't make a lot of sense that we
could prevent (e.g. reverse_bits(), ilogX(), etc.).
I think in this case there not a lot to gain from preventing this, considering
that we don't have derive macros yet.
However, I understand where you're coming from. Even though there's not a huge
gain here, it would be good to set an example -- especially if it's something as
cental as a file offset type.
If this is what you have in mind, let me go ahead and do it right away (at least
for the things needed by this patch series), because that's a very good reason I
think.
> So I don't want to delay real work, and as long as we do it early
> enough that we don't have many users, that sounds like a good idea to
> me -- done:
>
> https://github.com/Rust-for-Linux/linux/issues/1198
>
> Also took the chance to ask for a couple examples/tests.
Thanks a lot for creating the issue!
(I mainly also thought of adding one for a derive macro.)
next prev parent reply other threads:[~2025-10-21 17:34 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 22:26 [PATCH v2 0/8] Binary Large Objects for Rust DebugFS Danilo Krummrich
2025-10-20 22:26 ` [PATCH v2 1/8] rust: fs: add file::Offset type alias Danilo Krummrich
2025-10-21 13:40 ` Alice Ryhl
2025-10-21 15:08 ` Miguel Ojeda
2025-10-21 15:26 ` Danilo Krummrich
2025-10-21 16:00 ` Miguel Ojeda
2025-10-21 16:25 ` Danilo Krummrich
2025-10-21 16:47 ` Miguel Ojeda
2025-10-21 17:34 ` Danilo Krummrich [this message]
2025-10-21 23:16 ` Miguel Ojeda
2025-10-29 12:49 ` Christian Brauner
2025-10-29 15:26 ` Danilo Krummrich
2025-10-20 22:26 ` [PATCH v2 2/8] rust: uaccess: add UserSliceReader::read_slice_partial() Danilo Krummrich
2025-10-20 22:26 ` [PATCH v2 3/8] rust: uaccess: add UserSliceWriter::write_slice_partial() Danilo Krummrich
2025-10-21 14:00 ` Alice Ryhl
2025-10-21 14:14 ` Danilo Krummrich
2025-10-21 14:18 ` Alice Ryhl
2025-10-21 14:34 ` Danilo Krummrich
2025-10-22 8:22 ` Alice Ryhl
2025-10-22 9:06 ` Danilo Krummrich
2025-10-20 22:26 ` [PATCH v2 4/8] rust: debugfs: support for binary large objects Danilo Krummrich
2025-10-21 14:03 ` Alice Ryhl
2025-10-22 5:58 ` Alexandre Courbot
2025-10-20 22:26 ` [PATCH v2 5/8] rust: debugfs: support blobs from smart pointers Danilo Krummrich
2025-10-22 5:57 ` Alexandre Courbot
2025-10-22 9:34 ` Danilo Krummrich
2025-10-20 22:26 ` [PATCH v2 6/8] samples: rust: debugfs: add example for blobs Danilo Krummrich
2025-10-20 22:26 ` [PATCH v2 7/8] rust: debugfs: support binary large objects for ScopedDir Danilo Krummrich
2025-10-20 22:26 ` [PATCH v2 8/8] samples: rust: debugfs_scoped: add example for blobs Danilo Krummrich
2025-10-21 7:09 ` [PATCH v2 0/8] Binary Large Objects for Rust DebugFS Greg KH
2025-10-21 21:26 ` Matthew Maurer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DDO6IUEAVBR0.14AZ0UXFYQF48@kernel.org \
--to=dakr@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=brauner@kernel.org \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=mmaurer@google.com \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).