]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rust: sync: introduce `LockedBy`
authorWedson Almeida Filho <walmeida@microsoft.com>
Tue, 11 Apr 2023 05:45:43 +0000 (02:45 -0300)
committerMiguel Ojeda <ojeda@kernel.org>
Fri, 21 Apr 2023 22:20:00 +0000 (00:20 +0200)
commit7b1f55e3a984aaed0121f90f9f8580f18b7b561e
tree2963fe572363ca7b88310a2cf5ab014d2e8374e2
parent8da7a2b7432e8f043f04515895687f72cdb3e0a8
rust: sync: introduce `LockedBy`

This allows us to have data protected by a lock despite not being
wrapped by it. Access is granted by providing evidence that the lock is
held by the caller.

Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230411054543.21278-13-wedsonaf@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/sync.rs
rust/kernel/sync/lock.rs
rust/kernel/sync/locked_by.rs [new file with mode: 0644]