Re: [PATCH v6 04/20] rust: io: implement `Io` on reference types instead

From: Gary Guo

Date: Wed Jul 08 2026 - 08:08:46 EST


On Wed Jul 8, 2026 at 12:58 PM BST, Daniel Almeida wrote:
>
>> On 6 Jul 2026, at 09:44, Gary Guo <gary@xxxxxxxxxxx> wrote:
>>
>> Currently, `Io` is implemented on owned I/O objects (e.g. `Bar`). This is
>> going to change with I/O projections, as then `Io` needs to work both for
>> owned objects and views of them. Views are themselves reference-like
>> (however they obviously cannot be references, because they belong to a
>> different address space).
>>
>> To facilitate the change, change `Io` to be implemented on reference types
>> for the owned I/O objects, and make methods take `self` instead of `&self`.
>> When I/O views are implemented, we can then naturally implement `Io` for
>> these objects.
>>
>> Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
>> Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>
>> ---
>> rust/kernel/io.rs | 82 ++++++++++++++++++++++++++-------------------------
>> rust/kernel/pci/io.rs | 12 ++++----
>> 2 files changed, 48 insertions(+), 46 deletions(-)
>>
>
> Reviewed-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>

Hi Daniel,

Thanks for reviewing, however, it would be helpful if you can trim messages in
replies.

Thanks,
Gary