Messages in this thread | | | From | Andreas Hindborg <> | Subject | Re: [PATCH v2 4/4] rust: add abstraction for `struct page` | Date | Tue, 27 Feb 2024 09:32:27 +0100 |
| |
Hi Alice,
Alice Ryhl <aliceryhl@google.com> writes:
> Adds a new struct called `Page` that wraps a pointer to `struct page`. > This struct is assumed to hold ownership over the page, so that Rust > code can allocate and manage pages directly.
<cut>
> +/// A bitwise shift for the page size. > +pub const PAGE_SHIFT: usize = bindings::PAGE_SHIFT as usize; > +/// The number of bytes in a page. > +pub const PAGE_SIZE: usize = 1 << PAGE_SHIFT;
For consistency, could we get page size from bindings as well? The folio patches already do this [1].
BR Andreas
[1] https://lore.kernel.org/rust-for-linux/20231018122518.128049-10-wedsonaf@gmail.com/
| |