mm-constify-shmem-related-test-functions-for-improved-const-correctness.patch removed from -mm tree
The quilt patch titled
Subject: mm: constify shmem related test functions for improved const-correctness
has been removed from the -mm tree. Its filename was
mm-constify-shmem-related-test-functions-for-improved-const-correctness.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Max Kellermann <[email protected]>
Subject: mm: constify shmem related test functions for improved const-correctness
Date: Mon, 1 Sep 2025 22:50:10 +0200
Patch series "mm: establish const-correctness for pointer parameters", v6.
This series is to improved const-correctness in the low-level memory-management subsystem, which provides a basis for further constification further up the call stack (e.g. filesystems).
I started this work when I tried to constify the Ceph filesystem code, but found that to be impossible because many "mm" functions accept non-const pointers, even though they modify nothing.
This patch (of 12):
We select certain test functions which either invoke each other, functions that are already const-ified, or no further functions.
It is therefore relatively trivial to const-ify them, which provides a basis for further const-ification further up the call stack.
---
include/linux/mm.h | 8 ++++---- include/linux/shmem_fs.h | 4 ++-- mm/shmem.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-constify-shmem-related-test-functions-for-improved-const-correctness +4 -4
@@ -995,11 +995,11 @@ static inline void vma_iter_set(struct v* The vma_is_shmem is not inline because it is used only by slow * paths in userfault. */ -bool vma_is_shmem (struct vm_area_struct *vma); -bool vma_is_anon_shmem (struct vm_area_struct *vma); +bool vma_is_shmem (const struct vm_area_struct *vma); +bool vma_is_anon_shmem (const struct vm_area_struct *vma);#else -static inline bool vma_is_shmem (struct vm_area_struct *vma) {return false; } -static inline bool vma_is_anon_shmem (struct vm_area_struct *vma) {return false; } +static inline bool vma_is_shmem (const struct vm_area_struct *vma) {return false; } +static inline bool vma_is_anon_shmem (const struct vm_area_struct *vma) {return false; }#endif int vma_is_stack_for_current (struct vm_area_struct *vma);
include/linux/shmem_fs.h renamed from include/linux/shmem_fs.h~mm-constify-shmem-related-test-functions-for-improved-const-correctness +2 -2
@@ -99,9 +99,9 @@ extern unsigned long shmem_get_unmapped_ unsigned long len, unsigned long pgoff, unsigned long flags);extern int shmem_lock (struct file *file,int lock,struct ucounts *ucounts);#ifdef CONFIG_SHMEM -bool shmem_mapping (struct address_space *mapping); +bool shmem_mapping (const struct address_space *mapping);#else -static inline bool shmem_mapping (struct address_space *mapping) +static inline bool shmem_mapping (const struct address_space *mapping) {return false; }
mm/shmem.c renamed from mm/shmem.c~mm-constify-shmem-related-test-functions-for-improved-const-correctness +3 -3
@@ -275,18 +275,18 @@ static const struct vm_operations_structstatic const struct vm_operations_struct shmem_anon_vm_ops;static struct file_system_type shmem_fs_type; -bool shmem_mapping (struct address_space *mapping) +bool shmem_mapping (const struct address_space *mapping) {return mapping->a_ops == &shmem_aops; }EXPORT_SYMBOL_GPL (shmem_mapping); -bool vma_is_anon_shmem (struct vm_area_struct *vma) +bool vma_is_anon_shmem (const struct vm_area_struct *vma) {return vma->vm_ops == &shmem_anon_vm_ops; } -bool vma_is_shmem (struct vm_area_struct *vma) +bool vma_is_shmem (const struct vm_area_struct *vma) {return vma_is_anon_shmem (vma) || vma->vm_ops == &shmem_vm_ops; }
_
Patches currently in -mm which might be from [email protected] are