rust: sync: Make Guard::new() public
authorLyude Paul <lyude@redhat.com>
Tue, 19 Nov 2024 23:11:04 +0000 (18:11 -0500)
committerBoqun Feng <boqun.feng@gmail.com>
Thu, 19 Dec 2024 22:04:42 +0000 (14:04 -0800)
commitdaa03fe50ec376aeadd63a264c471c56af194e83
treecf646cb8f110d3c393fa6ce18d66e1c273a59ba0
parent15abc88057eeec052aefde897df277eca2340ac6
rust: sync: Make Guard::new() public

Since we added a `Lock::from_raw()` function previously, it makes sense
to also introduce an interface for creating a `Guard` from a reference
to a `Lock` for instances where we've derived the `Lock` from a raw
pointer and know that the lock is already acquired, there are such
usages in KMS API.

[Boqun: Add backquotes to type names, reformat the commit log, reword a
 bit on the usage of KMS API]

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Filipe Xavier <felipe_life@live.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://lore.kernel.org/r/20241119231146.2298971-3-lyude@redhat.com
rust/kernel/sync/lock.rs