pub struct MmWithUserAsync { /* private fields */ }
Expand description
A wrapper for the kernel’s struct mm_struct
.
This type is identical to MmWithUser
except that it uses mmput_async
when dropping a
refcount. This means that the destructor of ARef<MmWithUserAsync>
is safe to call in atomic
context.
§Invariants
Values of this type are always refcounted using mmget
. The value of mm_users
is non-zero.
Methods from Deref<Target = MmWithUser>§
Sourcepub fn lock_vma_under_rcu(&self, vma_addr: usize) -> Option<VmaReadGuard<'_>>
pub fn lock_vma_under_rcu(&self, vma_addr: usize) -> Option<VmaReadGuard<'_>>
Attempt to access a vma using the vma read lock.
This is an optimistic trylock operation, so it may fail if there is contention. In that case, you should fall back to taking the mmap read lock.
When per-vma locks are disabled, this always returns None
.
Sourcepub fn mmap_read_lock(&self) -> MmapReadGuard<'_>
pub fn mmap_read_lock(&self) -> MmapReadGuard<'_>
Lock the mmap read lock.
Sourcepub fn mmap_read_trylock(&self) -> Option<MmapReadGuard<'_>>
pub fn mmap_read_trylock(&self) -> Option<MmapReadGuard<'_>>
Try to lock the mmap read lock.
Methods from Deref<Target = Mm>§
Sourcepub fn mmget_not_zero(&self) -> Option<ARef<MmWithUser>>
pub fn mmget_not_zero(&self) -> Option<ARef<MmWithUser>>
Calls mmget_not_zero
and returns a handle if it succeeds.
Trait Implementations§
Source§impl AlwaysRefCounted for MmWithUserAsync
impl AlwaysRefCounted for MmWithUserAsync
Source§impl Deref for MmWithUserAsync
impl Deref for MmWithUserAsync
Source§type Target = MmWithUser
type Target = MmWithUser
The resulting type after dereferencing.
Source§fn deref(&self) -> &MmWithUser
fn deref(&self) -> &MmWithUser
Dereferences the value.
impl Send for MmWithUserAsync
impl Sync for MmWithUserAsync
Auto Trait Implementations§
impl !Freeze for MmWithUserAsync
impl !RefUnwindSafe for MmWithUserAsync
impl !Unpin for MmWithUserAsync
impl UnwindSafe for MmWithUserAsync
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more