<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/rust/kernel/sync/arc.rs, branch v6.16</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.16</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.16'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-05-26T16:03:09Z</updated>
<entry>
<title>rust: make section names plural</title>
<updated>2025-05-26T16:03:09Z</updated>
<author>
<name>Patrick Miller</name>
<email>paddymills@proton.me</email>
</author>
<published>2024-10-02T02:28:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4bf7b97eb390f0a0730572101e0ce3367d31a770'/>
<id>urn:sha1:4bf7b97eb390f0a0730572101e0ce3367d31a770</id>
<content type='text'>
Clean Rust documentation section headers to use plural names.

Suggested-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Link: https://github.com/Rust-for-Linux/linux/issues/1110
Signed-off-by: Patrick Miller &lt;paddymills@proton.me&gt;
Link: https://lore.kernel.org/r/20241002022749.390836-1-paddymills@proton.me
[ Removed the `init` one that doesn't apply anymore and
  reworded slightly. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'rust-xarray-for-v6.16' of https://github.com/Rust-for-Linux/linux into rust-next</title>
<updated>2025-05-18T18:36:56Z</updated>
<author>
<name>Miguel Ojeda</name>
<email>ojeda@kernel.org</email>
</author>
<published>2025-05-18T18:36:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=06ff274f25e96435147f2a7f4262a3d80204f064'/>
<id>urn:sha1:06ff274f25e96435147f2a7f4262a3d80204f064</id>
<content type='text'>
Pull XArray updates from Andreas Hindborg:
 "Introduce Rust support for the 'xarray' data structure:

   - Add a Rust abstraction for the 'xarray' data structure. This
     abstraction allows Rust code to leverage the 'xarray' to store
     types that implement 'ForeignOwnable'. This support is a dependency
     for memory backing feature of the Rust null block driver, which is
     waiting to be merged.

   - Set up an entry in MAINTAINERS for the XArray Rust support. Patches
     will go to the new Rust XArray tree and then via the Rust subsystem
     tree for now.

  'kernel' crate:

   - Allow 'ForeignOwnable' to carry information about the pointed-to
     type. This helps asserting alignment requirements for the pointer
     passed to the foreign language."

* tag 'rust-xarray-for-v6.16' of https://github.com/Rust-for-Linux/linux:
  MAINTAINERS: add entry for Rust XArray API
  rust: xarray: Add an abstraction for XArray
  rust: types: add `ForeignOwnable::PointedTo`
</content>
</entry>
<entry>
<title>rust: convert raw URLs to Markdown autolinks in comments</title>
<updated>2025-05-11T22:20:25Z</updated>
<author>
<name>Xizhe Yin</name>
<email>xizheyin@smail.nju.edu.cn</email>
</author>
<published>2025-04-07T03:34:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=86d990c7b699581918de2a379c6eebac7292940e'/>
<id>urn:sha1:86d990c7b699581918de2a379c6eebac7292940e</id>
<content type='text'>
Some comments in Rust files use raw URLs (http://example.com) rather
than Markdown autolinks &lt;URL&gt;. This inconsistency makes the
documentation less uniform and harder to maintain.

This patch converts all remaining raw URLs in Rust code comments to use
the Markdown autolink format, maintaining consistency with the rest of
the codebase which already uses this style.

Suggested-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Link: https://github.com/Rust-for-Linux/linux/issues/1153
Signed-off-by: Xizhe Yin &lt;xizheyin@smail.nju.edu.cn&gt;
Link: https://lore.kernel.org/r/509F0B66E3C1575D+20250407033441.5567-1-xizheyin@smail.nju.edu.cn
[ Used From form for Signed-off-by. Sorted tags. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: types: add `ForeignOwnable::PointedTo`</title>
<updated>2025-05-01T09:35:49Z</updated>
<author>
<name>Tamir Duberstein</name>
<email>tamird@gmail.com</email>
</author>
<published>2025-04-23T13:54:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1a4736c3d8394f5e64557a41b4b2b8d6dcd04622'/>
<id>urn:sha1:1a4736c3d8394f5e64557a41b4b2b8d6dcd04622</id>
<content type='text'>
Allow implementors to specify the foreign pointer type; this exposes
information about the pointed-to type such as its alignment.

This requires the trait to be `unsafe` since it is now possible for
implementors to break soundness by returning a misaligned pointer.

Encoding the pointer type in the trait (and avoiding pointer casts)
allows the compiler to check that implementors return the correct
pointer type. This is preferable to directly encoding the alignment in
the trait using a constant as the compiler would be unable to check it.

Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Signed-off-by: Tamir Duberstein &lt;tamird@gmail.com&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Link: https://lore.kernel.org/r/20250423-rust-xarray-bindings-v19-1-83cdcf11c114@gmail.com
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'rust-hrtimer-for-v6.15-v3' of https://github.com/Rust-for-Linux/linux into rust-next</title>
<updated>2025-03-25T22:41:14Z</updated>
<author>
<name>Miguel Ojeda</name>
<email>ojeda@kernel.org</email>
</author>
<published>2025-03-25T21:33:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e6ea10d5dbe082c54add289b44f08c9fcfe658af'/>
<id>urn:sha1:e6ea10d5dbe082c54add289b44f08c9fcfe658af</id>
<content type='text'>
Pull rust-hrtimer updates from Andreas Hindborg:
 "Introduce Rust support for the 'hrtimer' subsystem:

   - Add a way to use the 'hrtimer' subsystem from Rust. Rust code can
     now set up intrusive timers without allocating when starting the
     timer.

   - Add support for 'Pin&lt;Box&lt;_&gt;&gt;', 'Arc&lt;_&gt;', 'Pin&lt;&amp;_&gt;' and
     'Pin&lt;&amp;mut _&gt;' as pointer types for use with timer callbacks.

   - Add support for setting clock source and timer mode.

  'kernel' crate:

   - Add 'Arc::as_ptr' for converting an 'Arc' to a raw pointer. This is
     a dependency for the 'hrtimer' API.

   - Add 'Box::into_pin' for converting a 'Box&lt;_&gt;' into a 'Pin&lt;Box&lt;_&gt;&gt;'
     to align with Rust 'alloc'. This is a dependency for the 'hrtimer'
     API."

* tag 'rust-hrtimer-for-v6.15-v3' of https://github.com/Rust-for-Linux/linux:
  rust: hrtimer: add maintainer entry
  rust: hrtimer: add clocksource selection through `ClockId`
  rust: hrtimer: add `HrTimerMode`
  rust: hrtimer: implement `HrTimerPointer` for `Pin&lt;Box&lt;T&gt;&gt;`
  rust: alloc: add `Box::into_pin`
  rust: hrtimer: implement `UnsafeHrTimerPointer` for `Pin&lt;&amp;mut T&gt;`
  rust: hrtimer: implement `UnsafeHrTimerPointer` for `Pin&lt;&amp;T&gt;`
  rust: hrtimer: add `hrtimer::ScopedHrTimerPointer`
  rust: hrtimer: add `UnsafeHrTimerPointer`
  rust: hrtimer: allow timer restart from timer handler
  rust: hrtimer: implement `HrTimerPointer` for `Arc`
  rust: sync: add `Arc::as_ptr`
  rust: hrtimer: introduce hrtimer support
</content>
</entry>
<entry>
<title>rust: make pin-init its own crate</title>
<updated>2025-03-16T20:59:19Z</updated>
<author>
<name>Benno Lossin</name>
<email>benno.lossin@proton.me</email>
</author>
<published>2025-03-08T11:05:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dbd5058ba60c3499b24a7133a4e2e24dba6ea77b'/>
<id>urn:sha1:dbd5058ba60c3499b24a7133a4e2e24dba6ea77b</id>
<content type='text'>
Rename relative paths inside of the crate to still refer to the same
items, also rename paths inside of the kernel crate and adjust the build
system to build the crate.

[ Remove the `expect` (and thus the `lint_reasons` feature) since
  the tree now uses `quote!` from `rust/macros/export.rs`. Remove the
  `TokenStream` import removal, since it is now used as well.

  In addition, temporarily (i.e. just for this commit) use an `--extern
  force:alloc` to prevent an unknown `new_uninit` error in the `rustdoc`
  target. For context, please see a similar case in:

      https://lore.kernel.org/lkml/20240422090644.525520-1-ojeda@kernel.org/

  And adjusted the message above. - Miguel ]

Signed-off-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Fiona Behrens &lt;me@kloenk.dev&gt;
Tested-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Link: https://lore.kernel.org/r/20250308110339.2997091-16-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: move `InPlaceInit` and impls of `InPlaceWrite` into the kernel crate</title>
<updated>2025-03-16T20:59:18Z</updated>
<author>
<name>Benno Lossin</name>
<email>benno.lossin@proton.me</email>
</author>
<published>2025-03-08T11:04:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=114ca41fe7922ce85fcac30fa2b06b42b4956520'/>
<id>urn:sha1:114ca41fe7922ce85fcac30fa2b06b42b4956520</id>
<content type='text'>
In order to make pin-init a standalone crate, move kernel-specific code
directly into the kernel crate. This includes the `InPlaceInit&lt;T&gt;`
trait, its implementations and the implementations of `InPlaceWrite` for
`Arc` and `UniqueArc`. All of these use the kernel's error type which
will become unavailable in pin-init.

Signed-off-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Fiona Behrens &lt;me@kloenk.dev&gt;
Tested-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Link: https://lore.kernel.org/r/20250308110339.2997091-9-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: sync: add `Arc::as_ptr`</title>
<updated>2025-03-11T20:00:42Z</updated>
<author>
<name>Andreas Hindborg</name>
<email>a.hindborg@kernel.org</email>
</author>
<published>2025-03-09T15:18:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0c6fa8b8a59f8901e182fada6ac0e1f65beaa00'/>
<id>urn:sha1:a0c6fa8b8a59f8901e182fada6ac0e1f65beaa00</id>
<content type='text'>
Add a method to get a pointer to the data contained in an `Arc`.

Reviewed-by: Lyude Paul &lt;lyude@redhat.com&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Link: https://lore.kernel.org/r/20250309-hrtimer-v3-v6-12-rc2-v12-2-73586e2bd5f1@kernel.org
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: kernel: add improved version of `ForeignOwnable::borrow_mut`</title>
<updated>2025-01-13T22:46:07Z</updated>
<author>
<name>Alice Ryhl</name>
<email>aliceryhl@google.com</email>
</author>
<published>2024-11-20T11:46:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c27e705cb2b71769dbb4bb1bee1920d2fa01a597'/>
<id>urn:sha1:c27e705cb2b71769dbb4bb1bee1920d2fa01a597</id>
<content type='text'>
Previously, the `ForeignOwnable` trait had a method called `borrow_mut`
that was intended to provide mutable access to the inner value. However,
the method accidentally made it possible to change the address of the
object being modified, which usually isn't what we want. (And when we
want that, it can be done by calling `from_foreign` and `into_foreign`,
like how the old `borrow_mut` was implemented.)

In this patch, we introduce an alternate definition of `borrow_mut` that
solves the previous problem. Conceptually, given a pointer type `P` that
implements `ForeignOwnable`, the `borrow_mut` method gives you the same
kind of access as an `&amp;mut P` would, except that it does not let you
change the pointer `P` itself.

This is analogous to how the existing `borrow` method provides the same
kind of access to the inner value as an `&amp;P`.

Note that for types like `Arc`, having an `&amp;mut Arc&lt;T&gt;` only gives you
immutable access to the inner `T`. This is because mutable references
assume exclusive access, but there might be other handles to the same
reference counted value, so the access isn't exclusive. The `Arc` type
implements this by making `borrow_mut` return the same type as `borrow`.

Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Signed-off-by: Tamir Duberstein &lt;tamird@gmail.com&gt;
Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Link: https://lore.kernel.org/r/20241120-borrow-mut-v6-6-80dbadd00951@gmail.com
[ Updated to `crate::ffi::`. Reworded title slightly. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: kernel: reorder `ForeignOwnable` items</title>
<updated>2025-01-13T22:45:54Z</updated>
<author>
<name>Tamir Duberstein</name>
<email>tamird@gmail.com</email>
</author>
<published>2024-11-20T11:46:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c6b97538c2c0f4de5902b5bb78eb89bd34219df9'/>
<id>urn:sha1:c6b97538c2c0f4de5902b5bb78eb89bd34219df9</id>
<content type='text'>
`{into,from}_foreign` before `borrow` is slightly more logical.

This removes an inconsistency with `kbox.rs` which already uses this
ordering.

Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Signed-off-by: Tamir Duberstein &lt;tamird@gmail.com&gt;
Link: https://lore.kernel.org/r/20241120-borrow-mut-v6-5-80dbadd00951@gmail.com
[ Reworded title slightly. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
</feed>
