mirror of
https://github.com/torvalds/linux.git
synced 2025-11-03 01:59:51 +02:00
This type will be used when setting up a new vma in an f_ops->mmap() hook. Using a separate type from VmaRef allows us to have a separate set of operations that you are only able to use during the mmap() hook. For example, the VM_MIXEDMAP flag must not be changed after the initial setup that happens during the f_ops->mmap() hook. To avoid setting invalid flag values, the methods for clearing VM_MAYWRITE and similar involve a check of VM_WRITE, and return an error if VM_WRITE is set. Trying to use `try_clear_maywrite` without checking the return value results in a compilation error because the `Result` type is marked #[must_use]. For now, there's only a method for VM_MIXEDMAP and not VM_PFNMAP. When we add a VM_PFNMAP method, we will need some way to prevent you from setting both VM_MIXEDMAP and VM_PFNMAP on the same vma. Link: https://lkml.kernel.org/r/20250408-vma-v16-6-d8b446e885d9@google.com Signed-off-by: Alice Ryhl <aliceryhl@google.com> Acked-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Acked-by: Liam R. Howlett <Liam.Howlett@Oracle.com> Reviewed-by: Jann Horn <jannh@google.com> Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org> Cc: Alex Gaynor <alex.gaynor@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Balbir Singh <balbirs@nvidia.com> Cc: Benno Lossin <benno.lossin@proton.me> Cc: Björn Roy Baron <bjorn3_gh@protonmail.com> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Gary Guo <gary@garyguo.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Trevor Gross <tmgross@umich.edu> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
||
|---|---|---|
| .. | ||
| alloc | ||
| block | ||
| fs | ||
| list | ||
| mm | ||
| net | ||
| sync | ||
| time | ||
| .gitignore | ||
| alloc.rs | ||
| block.rs | ||
| build_assert.rs | ||
| cred.rs | ||
| device.rs | ||
| device_id.rs | ||
| devres.rs | ||
| dma.rs | ||
| driver.rs | ||
| error.rs | ||
| faux.rs | ||
| firmware.rs | ||
| fs.rs | ||
| generated_arch_static_branch_asm.rs.S | ||
| init.rs | ||
| io.rs | ||
| ioctl.rs | ||
| jump_label.rs | ||
| kunit.rs | ||
| lib.rs | ||
| list.rs | ||
| miscdevice.rs | ||
| mm.rs | ||
| net.rs | ||
| of.rs | ||
| page.rs | ||
| pci.rs | ||
| pid_namespace.rs | ||
| platform.rs | ||
| prelude.rs | ||
| print.rs | ||
| rbtree.rs | ||
| revocable.rs | ||
| security.rs | ||
| seq_file.rs | ||
| sizes.rs | ||
| static_assert.rs | ||
| std_vendor.rs | ||
| str.rs | ||
| sync.rs | ||
| task.rs | ||
| time.rs | ||
| tracepoint.rs | ||
| transmute.rs | ||
| types.rs | ||
| uaccess.rs | ||
| workqueue.rs | ||