Re: [PATCH v3 2/2] samples: rust: add sample code for scatterlist abstraction
From: Alexandre Courbot
Date: Wed Jul 23 2025 - 04:09:18 EST
On Wed Jul 23, 2025 at 9:54 AM JST, Daniel Almeida wrote:
<snip>
>> +struct WrappedArc(Arc<kernel::bindings::sg_table>);
>> +impl core::borrow::Borrow<kernel::bindings::sg_table> for WrappedArc {
>> + fn borrow(&self) -> &kernel::bindings::sg_table {
>> + &self.0
>> + }
>> }
>
> I assume there is no way to get around this without compromising somewhere
> else, right?
This should be undeeded now that [1] is in rust-next. `Arc` should now
be usable directly for the same purpose.
[1] https://lore.kernel.org/rust-for-linux/20250616-borrow_impls-v4-2-36f9beb3fe6a@xxxxxxxxxx/