Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/5] rust: add DropGuard
@ 2026-09-26 16:35 Mohamed Osama
  2026-09-26 16:35 ` [PATCH v2 1/5] rust: add DropGuard KUnit test configuration Mohamed Osama
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Mohamed Osama @ 2026-09-26 16:35 UTC (permalink / raw)
  To: ojeda
  Cc: boqun, gary, bjorn3_gh, lossin, a.hindborg, aliceryhl, tmgross,
	dakr, daniel.almeida, tamird, acourbot, work, longman, lyude,
	linux-block, linux-serial, rust-for-linux, linux-kernel

Add the Rust kernel DropGuard API and migrate the existing ScopeGuard
users in the block, serdev, and locking code.

DropGuard runs a FnOnce callback when dropped and provides dismiss() to
take ownership of the wrapped value without running the cleanup callback.

Changes since v1:
- Split the changes into separate patches for each affected module.
- Added a separate KUnit configuration patch.

The series was tested with:
- make LLVM=1 rustfmtcheck
- make LLVM=1 rustdoc
- make LLVM=1 -j$(nproc)
- git diff --check
- scripts/checkpatch.pl

Mohamed Osama (5):
  rust: add DropGuard KUnit test configuration
  rust: mem: add DropGuard
  rust: block: gen_disk: use DropGuard
  rust: serdev: use DropGuard
  rust: sync: lock: use DropGuard

 rust/kernel/Kconfig.test         |  10 +++
 rust/kernel/block/mq/gen_disk.rs |  11 +--
 rust/kernel/mem.rs               | 123 +++++++++++++++++++++++++++++++
 rust/kernel/serdev.rs            |  10 +--
 rust/kernel/sync/lock.rs         |   5 +-
 5 files changed, 146 insertions(+), 13 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-09-26 16:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-26 16:35 [PATCH v2 0/5] rust: add DropGuard Mohamed Osama
2026-09-26 16:35 ` [PATCH v2 1/5] rust: add DropGuard KUnit test configuration Mohamed Osama
2026-09-26 16:41   ` sashiko-bot
2026-09-26 16:35 ` [PATCH v2 2/5] rust: mem: add DropGuard Mohamed Osama
2026-09-26 16:46   ` sashiko-bot
2026-09-26 16:35 ` [PATCH v2 3/5] rust: block: gen_disk: use DropGuard Mohamed Osama
2026-09-26 16:42   ` sashiko-bot
2026-09-26 16:35 ` [PATCH v2 4/5] rust: serdev: " Mohamed Osama
2026-09-26 16:41   ` sashiko-bot
2026-09-26 16:35 ` [PATCH v2 5/5] rust: sync: lock: " Mohamed Osama
2026-09-26 16:41   ` sashiko-bot

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