summaryrefslogtreecommitdiff
path: root/rust/kernel/sync.rs
diff options
context:
space:
mode:
authorWedson Almeida Filho <walmeida@microsoft.com>2023-04-11 08:45:32 +0300
committerMiguel Ojeda <ojeda@kernel.org>2023-04-22 01:19:42 +0300
commit76d4bd591e1101df69c44c819041e374c63f1194 (patch)
treece071e007936453452d1d69f8d6a711a1003fdeb /rust/kernel/sync.rs
parent6ea5aa08857a81be7114b3c21d6aa6db0bc95f99 (diff)
downloadlinux-76d4bd591e1101df69c44c819041e374c63f1194.tar.xz
rust: sync: introduce `Lock` and `Guard`
They are generic Rust implementations of a lock and a lock guard that contain code that is common to all locks. Different backends will be introduced in subsequent commits. Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Suggested-by: Gary Guo <gary@garyguo.net> Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Link: https://lore.kernel.org/r/20230411054543.21278-2-wedsonaf@gmail.com [ Fixed typo. ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/sync.rs')
-rw-r--r--rust/kernel/sync.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/kernel/sync.rs b/rust/kernel/sync.rs
index 541d235ffbeb..81b0998eaa18 100644
--- a/rust/kernel/sync.rs
+++ b/rust/kernel/sync.rs
@@ -8,6 +8,7 @@
use crate::types::Opaque;
mod arc;
+pub mod lock;
pub use arc::{Arc, ArcBorrow, UniqueArc};
@@ -25,7 +26,6 @@ impl LockClassKey {
Self(Opaque::uninit())
}
- #[allow(dead_code)]
pub(crate) fn as_ptr(&self) -> *mut bindings::lock_class_key {
self.0.get()
}