rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Arc methods for linked list
@ 2024-03-11 16:08 Alice Ryhl
  2024-03-11 16:08 ` [PATCH v3 1/2] rust: sync: add `ArcBorrow::from_raw` Alice Ryhl
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Alice Ryhl @ 2024-03-11 16:08 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg
  Cc: rust-for-linux, linux-kernel, Alice Ryhl

This patchset contains two useful methods for the Arc type. They will be
used in my Rust linked list implementation, which Rust Binder uses. See
the Rust Binder RFC [1] for more information. Both these commits and
the linked list that uses them are present in the branch referenced by
the RFC.

I will send the linked list to the mailing list soon.

Link: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-0-08ba9197f637@google.com/ [1]
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Changes in v3:
- No changes to `ArcBorrow::from_raw`, or than adding a Reviewed-by.
- Update SAFETY comment on `refcount_dec_and_test` call.
- Simplify the creation of the `UniqueArc` in `into_unique_or_drop`.
- Link to v2: https://lore.kernel.org/r/20240228-arc-for-list-v2-0-ae93201426b4@google.com

Changes in v2:
- Move raw_to_inner_ptr to ArcInner and rename to container_of.
- Reword safety conditions for raw_to_inner_ptr to match its users.
- Link to v1: https://lore.kernel.org/r/20240219-arc-for-list-v1-0-d98cd92c760b@google.com

---
Alice Ryhl (2):
      rust: sync: add `ArcBorrow::from_raw`
      rust: sync: add `Arc::into_unique_or_drop`

 rust/kernel/sync/arc.rs | 106 ++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 88 insertions(+), 18 deletions(-)
---
base-commit: 768409cff6cc89fe1194da880537a09857b6e4db
change-id: 20240209-arc-for-list-a2c126c2ad5c

Best regards,
-- 
Alice Ryhl <aliceryhl@google.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-13 17:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-11 16:08 [PATCH v3 0/2] Arc methods for linked list Alice Ryhl
2024-03-11 16:08 ` [PATCH v3 1/2] rust: sync: add `ArcBorrow::from_raw` Alice Ryhl
2024-03-11 16:08 ` [PATCH v3 2/2] rust: sync: add `Arc::into_unique_or_drop` Alice Ryhl
2024-03-11 17:41   ` Benno Lossin
2024-03-12 17:28   ` Boqun Feng
2024-03-13  9:50     ` Alice Ryhl
2024-03-13 17:12       ` Boqun Feng
2024-03-13 17:08 ` [PATCH v3 0/2] Arc methods for linked list Boqun Feng

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).