rust: lockdep: Use Pin for all LockClassKey usages
authorMitchell Levy <levymitchell0@gmail.com>
Fri, 7 Mar 2025 23:27:01 +0000 (15:27 -0800)
committerIngo Molnar <mingo@kernel.org>
Fri, 7 Mar 2025 23:55:04 +0000 (00:55 +0100)
commitf73ca66f0d7f4371d172d6f5b1f9a00e367ba921
treef61b0e29525c92a198a8c0ab3389437e000f5b82
parent70b9c8563c9c29102a785d4822f0d77d33fee808
rust: lockdep: Use Pin for all LockClassKey usages

Reintroduce dynamically-allocated LockClassKeys such that they are
automatically (de)registered. Require that all usages of LockClassKeys
ensure that they are Pin'd.

Currently, only `'static` LockClassKeys are supported, so Pin is
redundant. However, it is intended that dynamically-allocated
LockClassKeys will eventually be supported, so using Pin from the outset
will make that change simpler.

Closes: https://github.com/Rust-for-Linux/linux/issues/1102
Suggested-by: Benno Lossin <benno.lossin@proton.me>
Suggested-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Mitchell Levy <levymitchell0@gmail.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20250307232717.1759087-12-boqun.feng@gmail.com
rust/helpers/helpers.c
rust/helpers/sync.c [new file with mode: 0644]
rust/kernel/sync.rs
rust/kernel/sync/condvar.rs
rust/kernel/sync/lock.rs
rust/kernel/sync/lock/global.rs
rust/kernel/sync/poll.rs
rust/kernel/workqueue.rs