The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andreas Hindborg <a.hindborg@kernel.org>
To: "Gary Guo" <gary@garyguo.net>,
	"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 14:24:53 +0200	[thread overview]
Message-ID: <87tsrdgqy2.fsf@kernel.org> (raw)
In-Reply-To: <DJ3NFHS2N5PB.1W7NB3EETHMIB@garyguo.net>

"Gary Guo" <gary@garyguo.net> writes:

> 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]

Sashiko will do this for you now 😆


Best regards,
Andreas Hindborg




      reply	other threads:[~2026-06-08 12:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 11:47 [PATCH] rust: alloc: add `NumaNode::id()` accessor Andreas Hindborg
2026-06-08 11:58 ` Gary Guo
2026-06-08 12:24   ` Andreas Hindborg [this message]

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=87tsrdgqy2.fsf@kernel.org \
    --to=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --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