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: page: convert to `Ownable` Date: Fri, 27 Feb 2026 15:11:58 +1000 Message-ID: In-Reply-To: <20260224-unique-ref-v16-8-c21afcb118d3@kernel.org> References: <20260224-unique-ref-v16-0-c21afcb118d3@kernel.org> <20260224-unique-ref-v16-8-c21afcb118d3@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review This converts `Page` from a directly-owned type (with `Drop`) to an `Ownable` type (used via `Owned`). Key change: `Page` becomes `#[repr(transparent)]` wrapping `Opaque` instead of `NonNull`. This allows the `Page` type to be used as a reference target (like `&Page`) rather than only as a move-value. ```rust pub struct Page { page: Opaque, } ``` `alloc_page` now returns `Owned` instead of `Page`: ```rust pub fn alloc_page(flags: Flags) -> Result, AllocError> { ``` The `BorrowedPage` internals change from `ManuallyDrop` to `ManuallyDrop>`, which makes sense since `Page` is no longer directly constructible. The `Ownable` impl correctly frees the page: ```rust impl Ownable for Page { unsafe fn release(&mut self) { let ptr: *mut Self = self; unsafe { bindings::__free_pages(ptr.cast(), 0) }; } } ``` This works because `Page` is `#[repr(transparent)]` over `Opaque`, so `ptr.cast()` gives a valid `*mut bindings::page`. --- Generated by Claude Code Patch Reviewer