Commit 84aa9d63 authored by Alice Ryhl's avatar Alice Ryhl
Browse files

FROMLIST: mm: rust: add vm_area_struct methods that require read access



This adds a type called VmAreaRef which is used when referencing a vma
that you have read access to. Here, read access means that you hold
either the mmap read lock or the vma read lock (or stronger).

Additionally, a vma_lookup method is added to the mmap read guard, which
enables you to obtain a &VmAreaRef in safe Rust code.

This patch only provides a way to lock the mmap read lock, but a
follow-up patch also provides a way to just lock the vma read lock.

Acked-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> (for mm bits)
Reviewed-by: default avatarJann Horn <jannh@google.com>
Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>

Bug: 370906207
Link: https://lore.kernel.org/all/20250115-vma-v12-2-375099ae017a@google.com/


Change-Id: I6e1fc0d60c1a578edac41680855a60401d05cafd
Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
parent 4deea7dc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment