rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] BorrowedPage, IntoPageIter and VmallocPageIter
@ 2025-08-08 18:10 Danilo Krummrich
  2025-08-08 18:10 ` [PATCH v3 1/7] rust: page: implement BorrowedPage Danilo Krummrich
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Danilo Krummrich @ 2025-08-08 18:10 UTC (permalink / raw)
  To: lorenzo.stoakes, vbabka, Liam.Howlett, urezki, ojeda, alex.gaynor,
	boqun.feng, gary, bjorn3_gh, lossin, a.hindborg, aliceryhl,
	tmgross, abdiel.janulgue, acourbot
  Cc: rust-for-linux, Danilo Krummrich

This patch series implements the BorrowedPage type, the IntoPageIter trait and
VmallocPageIter type.

IntoPageIter can be implemented by any type that owns pages to allow users to
borrow them through a generic interface.

For instance, this is useful to access and borrow the backing pages of
allocation primitives, such as Box and Vec, backing a scatterlist.

Hence, implement IntoPageIter for VBox and VVec.

Additionally, implement Vmalloc::to_page() and ArrayLayout::size(), which are
dependencies of the above.

Changes in v3:
  - Generalize the previous PageOwner impl of VBox and VVec in VmallocPageIter.
  - Correspondingly, replace PageOwner with IntoPageIter.

Changes in v2:
  - BorrowedPage
    - Add link to Ownable
    - Use borrow_page() in the example
  - Add PageOwner, Vmalloc::to_page(), ArrayLayout, VBox, VVec patches.

Danilo Krummrich (7):
  rust: page: implement BorrowedPage
  rust: alloc: vmalloc: implement Vmalloc::to_page()
  rust: alloc: implement VmallocPageIter
  rust: page: define trait IntoPageIter
  rust: alloc: kbox: implement IntoPageIter for VBox
  rust: alloc: layout: implement ArrayLayout::size()
  rust: alloc: kvec: implement IntoPageIter for VVec

 rust/bindings/bindings_helper.h |   1 +
 rust/kernel/alloc/allocator.rs  | 141 ++++++++++++++++++++++++++++++++
 rust/kernel/alloc/kbox.rs       |  37 ++++++++-
 rust/kernel/alloc/kvec.rs       |  37 ++++++++-
 rust/kernel/alloc/layout.rs     |   5 ++
 rust/kernel/page.rs             |  85 ++++++++++++++++++-
 6 files changed, 303 insertions(+), 3 deletions(-)


base-commit: d2eedaa3909be9102d648a4a0a50ccf64f96c54f
-- 
2.50.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-08-19 13:10 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-08 18:10 [PATCH v3 0/7] BorrowedPage, IntoPageIter and VmallocPageIter Danilo Krummrich
2025-08-08 18:10 ` [PATCH v3 1/7] rust: page: implement BorrowedPage Danilo Krummrich
2025-08-08 18:10 ` [PATCH v3 2/7] rust: alloc: vmalloc: implement Vmalloc::to_page() Danilo Krummrich
2025-08-11  9:11   ` Alice Ryhl
2025-08-08 18:10 ` [PATCH v3 3/7] rust: alloc: implement VmallocPageIter Danilo Krummrich
2025-08-11  9:14   ` Alice Ryhl
2025-08-11  9:30     ` Danilo Krummrich
2025-08-08 18:10 ` [PATCH v3 4/7] rust: page: define trait IntoPageIter Danilo Krummrich
2025-08-11  8:57   ` Alice Ryhl
2025-08-11  9:01     ` Danilo Krummrich
2025-08-11  9:16   ` Alice Ryhl
2025-08-11 10:38     ` Danilo Krummrich
2025-08-11 10:41       ` Alice Ryhl
2025-08-08 18:10 ` [PATCH v3 5/7] rust: alloc: kbox: implement IntoPageIter for VBox Danilo Krummrich
2025-08-08 18:10 ` [PATCH v3 6/7] rust: alloc: layout: implement ArrayLayout::size() Danilo Krummrich
2025-08-19 13:09   ` Daniel Almeida
2025-08-08 18:10 ` [PATCH v3 7/7] rust: alloc: kvec: implement IntoPageIter for VVec Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).