summaryrefslogtreecommitdiff
path: root/rust/kernel
diff options
context:
space:
mode:
authorLyude Paul <lyude@redhat.com>2024-11-20 02:11:04 +0300
committerBoqun Feng <boqun.feng@gmail.com>2024-12-20 01:04:42 +0300
commitdaa03fe50ec376aeadd63a264c471c56af194e83 (patch)
treecf646cb8f110d3c393fa6ce18d66e1c273a59ba0 /rust/kernel
parent15abc88057eeec052aefde897df277eca2340ac6 (diff)
downloadlinux-daa03fe50ec376aeadd63a264c471c56af194e83.tar.xz
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
Diffstat (limited to 'rust/kernel')
-rw-r--r--rust/kernel/sync/lock.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/kernel/sync/lock.rs b/rust/kernel/sync/lock.rs
index 57dc2e90e504..72dbf3fbb259 100644
--- a/rust/kernel/sync/lock.rs
+++ b/rust/kernel/sync/lock.rs
@@ -234,7 +234,7 @@ impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> {
/// # Safety
///
/// The caller must ensure that it owns the lock.
- pub(crate) unsafe fn new(lock: &'a Lock<T, B>, state: B::GuardState) -> Self {
+ pub unsafe fn new(lock: &'a Lock<T, B>, state: B::GuardState) -> Self {
Self {
lock,
state,