Lines Matching +full:reference +full:- +full:sync

1 // SPDX-License-Identifier: GPL-2.0
16 sync::aref::{ARef, AlwaysRefCounted},
55 unsafe impl Sync for Mm {}
61 // SAFETY: The pointer is valid since self is a reference. in inc_ref()
74 /// This type is like [`Mm`], but with non-zero `mm_users`. It can only be used when `mm_users` can
75 /// be proven to be non-zero at compile-time, usually because the relevant code holds an `mmget`
82 /// Values of this type are always refcounted using `mmget`. The value of `mm_users` is non-zero.
91 unsafe impl Sync for MmWithUser {}
97 // SAFETY: The pointer is valid since self is a reference. in inc_ref()
113 fn deref(&self) -> &Mm { in deref()
122 pub fn as_raw(&self) -> *mut bindings::mm_struct { in as_raw()
126 /// Obtain a reference from a raw pointer.
133 pub unsafe fn from_raw<'a>(ptr: *const bindings::mm_struct) -> &'a Mm { in from_raw()
141 pub fn mmget_not_zero(&self) -> Option<ARef<MmWithUser>> { in mmget_not_zero()
142 // SAFETY: The pointer is valid since self is a reference. in mmget_not_zero()
154 // These methods require `mm_users` to be non-zero.
156 /// Obtain a reference from a raw pointer.
161 /// non-zero for the duration of the lifetime 'a.
163 pub unsafe fn from_raw<'a>(ptr: *const bindings::mm_struct) -> &'a MmWithUser { in from_raw()
174 /// When per-vma locks are disabled, this always returns `None`.
176 pub fn lock_vma_under_rcu(&self, vma_addr: usize) -> Option<VmaReadGuard<'_>> { in lock_vma_under_rcu()
180 // `mm_users` is non-zero. in lock_vma_under_rcu()
184 // SAFETY: If `lock_vma_under_rcu` returns a non-null ptr, then it points at a in lock_vma_under_rcu()
201 pub fn mmap_read_lock(&self) -> MmapReadGuard<'_> { in mmap_read_lock()
202 // SAFETY: The pointer is valid since self is a reference. in mmap_read_lock()
214 pub fn mmap_read_trylock(&self) -> Option<MmapReadGuard<'_>> { in mmap_read_trylock()
215 // SAFETY: The pointer is valid since self is a reference. in mmap_read_trylock()
244 pub fn vma_lookup(&self, vma_addr: usize) -> Option<&virt::VmaRef> { in vma_lookup()
256 // after the MmapReadGuard gets dropped is enforced by the borrow-checker. in vma_lookup()
286 fn deref(&self) -> &VmaRef { in deref()