* [PATCH] mm/mmap: make accountable_mapping return bool
@ 2024-04-07 6:38 Hao Ge
0 siblings, 0 replies; only message in thread
From: Hao Ge @ 2024-04-07 6:38 UTC (permalink / raw)
To: akpm, Liam.Howlett, vbabka, lstoakes, willy
Cc: linux-mm, linux-kernel, gehao618, Hao Ge
accountable_mapping can return bool,so we change it
Signed-off-by: Hao Ge <gehao@kylinos.cn>
---
mm/mmap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index ac219f1689e0..e37dd5c9ffee 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1549,14 +1549,14 @@ bool vma_wants_writenotify(struct vm_area_struct *vma, pgprot_t vm_page_prot)
* We account for memory if it's a private writeable mapping,
* not hugepages and VM_NORESERVE wasn't set.
*/
-static inline int accountable_mapping(struct file *file, vm_flags_t vm_flags)
+static inline bool accountable_mapping(struct file *file, vm_flags_t vm_flags)
{
/*
* hugetlb has its own accounting separate from the core VM
* VM_HUGETLB may not be set yet so we cannot check for that flag.
*/
if (file && is_file_hugepages(file))
- return 0;
+ return false;
return (vm_flags & (VM_NORESERVE | VM_SHARED | VM_WRITE)) == VM_WRITE;
}
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-07 6:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-07 6:38 [PATCH] mm/mmap: make accountable_mapping return bool Hao Ge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox