diff options
author | Kartik Prajapati <[email protected]> | 2024-08-21 19:58:58 +0000 |
---|---|---|
committer | Miguel Ojeda <[email protected]> | 2024-08-25 14:44:39 +0200 |
commit | 96fff2dc2954dcaf7affe7da212aba3f5107d06d (patch) | |
tree | 4e95daa677b91cbca0a8a68616d353bf82a32074 /rust/kernel/lib.rs | |
parent | c73051168e7fc0c78e58791097cbc3a3ec95839e (diff) |
rust: types: add `ARef::into_raw`
Add a method for `ARef` that is analogous to `Arc::into_raw`. It is the
inverse operation of `ARef::from_raw`, and allows you to convert the
`ARef` back into a raw pointer while retaining ownership of the
refcount.
This new function will be used by [1] for converting the type in an
`ARef` using `ARef::from_raw(ARef::into_raw(me).cast())`. Alice has
also needed the same function for other use-cases in the past, but [1]
is the first to go upstream.
This was implemented independently by Kartik and Alice. The two versions
were merged by Alice, so all mistakes are Alice's.
Link: https://lore.kernel.org/r/[email protected] [1]
Link: https://github.com/Rust-for-Linux/linux/issues/1044
Signed-off-by: Kartik Prajapati <[email protected]>
Co-developed-by: Alice Ryhl <[email protected]>
Signed-off-by: Alice Ryhl <[email protected]>
Reviewed-by: Benno Lossin <[email protected]>
[ Reworded to correct the author reference and changed tag to Link
since it is not a bug. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'rust/kernel/lib.rs')
0 files changed, 0 insertions, 0 deletions