From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: add `Ownable` trait and `Owned` type Date: Mon, 23 Feb 2026 06:08:49 +1000 Message-ID: In-Reply-To: <20260220-unique-ref-v15-0-893ed86b06cc@kernel.org> References: <20260220-unique-ref-v15-0-893ed86b06cc@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Overall Series Review Subject: rust: add `Ownable` trait and `Owned` type Author: Andreas Hindborg Patches: 15 Reviewed: 2026-02-23T06:08:49.862113 --- This is v15 of a Rust kernel infrastructure series by Andreas Hindborg (with contributions from Asahi Lina and Oliver Mangold) that introduces the `Ownable` trait and `Owned` smart pointer type. The series provides a way for C-allocated objects to be uniquely owned by Rust code with custom drop logic, analogous to how `AlwaysRefCounted`/`ARef` works for reference-counted objects. It also adds `OwnableRefCounted` for converting between `Owned` and `ARef`, converts `Page` to use the new infrastructure, implements `ForeignOwnable` for `Owned`, and adds `Page::from_raw()`. The architecture is sound: splitting `AlwaysRefCounted` into `RefCounted` (the actual refcounting interface) and `AlwaysRefCounted` (a marker trait that permits `&T -> ARef` conversions) is a correct way to prevent soundness issues when a type can be both uniquely owned and ref-counted. The `Owned` type is well-designed as a pinned unique pointer with custom destruction. I found one likely bug in the `ForeignOwnable` implementation for `Owned` (`FOREIGN_ALIGN` is set incorrectly), a documentation link error, and a few documentation concerns. The mailing list feedback from Alice Ryhl and Miguel Ojeda is also incorporated below where relevant, as several of their comments identify real issues. --- Generated by Claude Code Patch Reviewer