From: "Gary Guo" <gary@garyguo.net>
To: "Andreas Hindborg" <a.hindborg@kernel.org>,
"Danilo Krummrich" <dakr@kernel.org>,
"Lorenzo Stoakes" <ljs@kernel.org>,
"Vlastimil Babka" <vbabka@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
"Uladzislau Rezki" <urezki@gmail.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>
Cc: <rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rust: alloc: add `NumaNode::id()` accessor
Date: Mon, 08 Jun 2026 12:58:59 +0100 [thread overview]
Message-ID: <DJ3NFHS2N5PB.1W7NB3EETHMIB@garyguo.net> (raw)
In-Reply-To: <20260608-numa-node-id-v1-1-28480299c62d@kernel.org>
On Mon Jun 8, 2026 at 12:47 PM BST, Andreas Hindborg wrote:
> `NumaNode` wraps an `i32` but offers no way to read it back. Add a
> trivial `id()` getter so callers that need to pass the node id to a
> C binding can recover the underlying `c_int` without reaching into
> the private field.
>
> Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
> ---
> This will be used by an upcoming change that adds a home node parameter to
> the block layer `TagSet::new()` constructor.
> ---
> rust/kernel/alloc.rs | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/rust/kernel/alloc.rs b/rust/kernel/alloc.rs
> index e38720349dcf..c02290bb79d9 100644
> --- a/rust/kernel/alloc.rs
> +++ b/rust/kernel/alloc.rs
> @@ -126,6 +126,11 @@ pub fn new(node: i32) -> Result<Self> {
> }
> Ok(Self(node))
> }
> +
> + /// Returns the raw NUMA node identifier as an `i32`.
#[inline]
> + pub fn id(&self) -> i32 {
> + self.0
> + }
> }
>
> /// Specify necessary constant to pass the information to Allocator that the caller doesn't care
>
> ---
> base-commit: 7fd2df204f342fc17d1a0bfcd474b24232fb0f32
> change-id: 20260608-numa-node-id-85de708d4e8d
>
> Best regards,
> --
> Andreas Hindborg <a.hindborg@kernel.org>
next prev parent reply other threads:[~2026-06-08 11:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 11:47 Andreas Hindborg
2026-06-08 11:58 ` Gary Guo [this message]
2026-06-08 12:24 ` Andreas Hindborg
2026-06-10 7:09 ` Alice Ryhl
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=DJ3NFHS2N5PB.1W7NB3EETHMIB@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ljs@kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
--cc=urezki@gmail.com \
--cc=vbabka@kernel.org \
/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
all inboxes | Powered by JetHome®