BorrowedPage, AsPageIter and VmallocPageIter
Status from this message: Applied to drm-rust-next, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest7 patches 1 replyApplied
- v47 patches 20 repliesSuperseded
- v37 patches 9 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 6 patches | 14 replies | Superseded | |
| v1 | 1 patch | 10 replies | Superseded |
Changes in v5 from the cover letter
- Avoid repetition in commit message of "rust: alloc: implement VmallocPageIter".
- Change invariants of VmallocPageIter to:
- buf is a valid and [page::PAGE_SIZE] aligned pointer into a [Vmalloc] allocation.
- size is the number of bytes from buf until the end of the [Vmalloc] allocation buf points to.
- Inline some methods of VmallocPageIter.
Patches in v5 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | rust: page: implement BorrowedPagerust/ rust/ | +75 | 0 replies | |
| 2/7 | rust: alloc: vmalloc: implement Vmalloc::to_page()rust/ | +49 | 0 replies | |
| 3/7 | rust: alloc: implement VmallocPageIterrust/ | +103 | 0 replies | |
| 4/7 | rust: page: define trait AsPageIterrust/ | +12 | 0 replies | |
| 5/7 | rust: alloc: kbox: implement AsPageIter for VBoxrust/ | +39 | 0 replies | |
| 6/7 | rust: alloc: layout: implement ArrayLayout::size()rust/ | +5 | 0 replies | |
| 7/7 | rust: alloc: kvec: implement AsPageIter for VVecrust/ | +39 | 0 replies |
Reviews trailers per patch
All 7 patches have a Reviewed-by or Acked-by.
| Patch | Alice Ryhl | Alexandre Courbot | Daniel Almeida |
|---|---|---|---|
| 1/7 | A-b | R-b T-b | R-b |
| 2/7 | R-b | R-b T-b | R-b |
| 3/7 | R-b | R-b T-b | R-b |
| 4/7 | R-b | R-b T-b | R-b |
| 5/7 | R-b | R-b T-b | |
| 6/7 | R-b | R-b T-b | |
| 7/7 | R-b | R-b T-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v5 0/7] BorrowedPage, AsPageIter and VmallocPageIter
This patch series implements the BorrowedPage type, the AsPageIter trait and VmallocPageIter type.
AsPageIter 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 AsPageIter for VBox and VVec.
Additionally, implement Vmalloc::to_page() and ArrayLayout::size(), which are dependencies of the above.
Changes in v5:
- Avoid repetition in commit message of "rust: alloc: implement VmallocPageIter".
- Change invariants of VmallocPageIter to:
- buf is a valid and [page::PAGE_SIZE] aligned pointer into a [Vmalloc] allocation.
- size is the number of bytes from buf until the end of the [Vmalloc] allocation buf points to.
- Inline some methods of VmallocPageIter.
Changes in v4:
- Rename IntoPageIter into AsPageIter.
- Put lifetime on AsPageIter::Iter instead of AsPageIter itself.
- Implement size_hint() for VmallocPageIter.
- Use PhantomData<page::BorrowedPage<'a>> instead of PhantomData<&'a u8>.
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 AsPageIter
rust: alloc: kbox: implement AsPageIter for VBox
rust: alloc: layout: implement ArrayLayout::size()
rust: alloc: kvec: implement AsPageIter for VVec
rust/bindings/bindings_helper.h | 1 + rust/kernel/alloc/allocator.rs | 152 ++++++++++++++++++++++++++++++++ rust/kernel/alloc/kbox.rs | 40 ++++++++- rust/kernel/alloc/kvec.rs | 40 ++++++++- rust/kernel/alloc/layout.rs | 5 ++ rust/kernel/page.rs | 87 +++++++++++++++++- 6 files changed, 322 insertions(+), 3 deletions(-)
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
Signature · 1 line
2.50.1