linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] rust: zpool: add abstraction for zpool drivers
@ 2025-08-29  7:17 Vitaly Wool
  2025-08-29  7:18 ` [PATCH v5 1/2] rust: alloc: add from_raw method to Flags Vitaly Wool
  2025-08-29  7:18 ` [PATCH v5 2/2] rust: zpool: add abstraction for zpool drivers Vitaly Wool
  0 siblings, 2 replies; 3+ messages in thread
From: Vitaly Wool @ 2025-08-29  7:17 UTC (permalink / raw)
  To: rust-for-linux
  Cc: linux-kernel, Uladzislau Rezki, Danilo Krummrich, Alice Ryhl,
	Vlastimil Babka, Lorenzo Stoakes, Liam R . Howlett, Miguel Ojeda,
	Alex Gaynor, Boqun Feng, Gary Guo, Bjorn Roy Baron, Benno Lossin,
	Andreas Hindborg, Trevor Gross, Johannes Weiner, Yosry Ahmed,
	Nhat Pham, linux-mm, Vitaly Wool

Zpool is a common frontend for memory storage pool implementations.
These pools are typically used to store compressed memory objects,
e. g. for Zswap, the lightweight compressed cache for swap pages.

This patch provides the interface to use Zpool in Rust kernel code,
thus enabling Rust implementations of Zpool allocators for arbitrary
Zpool users.

Co-developed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.se>
---
Changelog:
v1 -> v2:
* reworked to stick to the existing Rust driver infrastructure
* removed raw pointers from the Rust API
v2 -> v3:
* detailed safety requirements for unsafe API functions
* removed unwrap()
* some typo corrections
v3 -> v4:
* added a working example of zpool Rust API usage in the
  documentation part
* change to Flags arranged as a separate patch
* improved safety requirements for ZpoolDriver trait
v4 -> v5:
* created a new type ZpoolHandle for handle representation on the
  Rust side
* improved description of Flags::from_raw()
* pool is no more borrowed as mutable for ZpoolDriver::malloc()
* ZpoolDriver::destroy() removed
* improved ZpoolDriver implementation example
* typos/markup corrections
* new files added to MAINTAINERS
---
 MAINTAINERS                     |    2 
 rust/bindings/bindings_helper.h |    1 
 rust/helpers/helpers.c          |    1 
 rust/helpers/zpool.c            |    8 +
 rust/kernel/alloc.rs            |    7 +
 rust/kernel/lib.rs              |    2 
 rust/kernel/zpool.rs            |  377 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 398 insertions(+)


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

end of thread, other threads:[~2025-08-29  7:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-29  7:17 [PATCH v5 0/2] rust: zpool: add abstraction for zpool drivers Vitaly Wool
2025-08-29  7:18 ` [PATCH v5 1/2] rust: alloc: add from_raw method to Flags Vitaly Wool
2025-08-29  7:18 ` [PATCH v5 2/2] rust: zpool: add abstraction for zpool drivers Vitaly Wool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox