<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/rust/kernel/xarray.rs, branch master</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=master</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2026-03-27T11:49:00+00:00</updated>
<entry>
<title>rust: kernel: mark as `#[inline]` all `From::from()`s for `Error`</title>
<updated>2026-03-27T11:49:00+00:00</updated>
<author>
<name>Alistair Francis</name>
<email>alistair.francis@wdc.com</email>
</author>
<published>2026-03-26T02:04:06+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=4f13c93497e366cd8e41561a8e30ad4da887cb82'/>
<id>urn:sha1:4f13c93497e366cd8e41561a8e30ad4da887cb82</id>
<content type='text'>
There was a recent request [1] to mark as `#[inline]` the simple
`From::from()` functions implemented for `Error`.

Thus mark all of the existing

    impl From&lt;...&gt; for Error {
        fn from(err: ...) -&gt; Self {
            ...
        }
    }

functions in the `kernel` crate as `#[inline]`.

Suggested-by: Gary Guo &lt;gary@garyguo.net&gt;
Link: https://lore.kernel.org/all/8403c8b7a832b5274743816eb77abfa4@garyguo.net/ [1]
Signed-off-by: Alistair Francis &lt;alistair.francis@wdc.com&gt;
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Acked-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Link: https://patch.msgid.link/20260326020406.1438210-1-alistair.francis@wdc.com
[ Dropped `projection.rs` since it is in another tree and already marked
  as `inline(always)` and reworded accordingly. Changed Link tag to
  Gary's original message and added Suggested-by. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: types: add FOREIGN_ALIGN to ForeignOwnable</title>
<updated>2025-07-14T21:55:24+00:00</updated>
<author>
<name>Andreas Hindborg</name>
<email>a.hindborg@kernel.org</email>
</author>
<published>2025-06-12T13:09:43+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=12717ebeffcf3e34063dbc1e1b7f34924150c7c9'/>
<id>urn:sha1:12717ebeffcf3e34063dbc1e1b7f34924150c7c9</id>
<content type='text'>
The current implementation of `ForeignOwnable` is leaking the type of the
opaque pointer to consumers of the API. This allows consumers of the opaque
pointer to rely on the information that can be extracted from the pointer
type.

To prevent this, change the API to the version suggested by Maira
Canal (link below): Remove `ForeignOwnable::PointedTo` in favor of a
constant, which specifies the alignment of the pointers returned by
`into_foreign`.

With this change, `ArcInner` no longer needs `pub` visibility, so change it
to private.

Suggested-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Suggested-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Link: https://lore.kernel.org/r/20240309235927.168915-3-mcanal@igalia.com
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Reviewed-by: Benno Lossin &lt;lossin@kernel.org&gt;
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Link: https://lore.kernel.org/r/20250612-pointed-to-v3-1-b009006d86a1@kernel.org
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: xarray: Add an abstraction for XArray</title>
<updated>2025-05-01T09:37:59+00:00</updated>
<author>
<name>Tamir Duberstein</name>
<email>tamird@gmail.com</email>
</author>
<published>2025-04-23T13:54:38+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=210b81578efbe5c5e7748e50d313e1a90b03df55'/>
<id>urn:sha1:210b81578efbe5c5e7748e50d313e1a90b03df55</id>
<content type='text'>
`XArray` is an efficient sparse array of pointers. Add a Rust
abstraction for this type.

This implementation bounds the element type on `ForeignOwnable` and
requires explicit locking for all operations. Future work may leverage
RCU to enable lockless operation.

Inspired-by: Maíra Canal &lt;mcanal@igalia.com&gt;
Inspired-by: Asahi Lina &lt;lina@asahilina.net&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Signed-off-by: Tamir Duberstein &lt;tamird@gmail.com&gt;
Link: https://lore.kernel.org/r/20250423-rust-xarray-bindings-v19-2-83cdcf11c114@gmail.com
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</content>
</entry>
</feed>
