mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
mm/rmap: update mm/interval_tree.c comments
Update the file comment to clarify that both file-backed and anonymous interval trees are provided, referencing the relevant data types for clarity. Also add comments to indicate which parts of the file apply to each. While we're here, convert the VM_BUG_ON_VMA() to VM_WARN_ON_ONCE_VMA(). Link: https://lore.kernel.org/20260710-b4-pre-scalable-cow-v2-5-2a5aa403d977@kernel.org Signed-off-by: Lorenzo Stoakes <ljs@kernel.org> Reviewed-by: Pedro Falcato <pfalcato@suse.de> Reviewed-by: Gregory Price <gourry@gourry.net> Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org> Reviewed-by: Zi Yan <ziy@nvidia.com> Cc: Ackerley Tng <ackerleytng@google.com> Cc: David Hildenbrand (Arm) <david@kernel.org> Cc: Kai Huang <kai.huang@intel.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: SJ Park <sj@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Liam R. Howlett (Oracle) <liam@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
1219731c49
commit
dbde17041c
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* mm/interval_tree.c - interval tree for mapping->i_mmap
|
||||
* mm/interval_tree.c - interval tree for address_space->i_mmap and
|
||||
* anon_vma->rb_root
|
||||
*
|
||||
* Copyright (C) 2012, Michel Lespinasse <walken@google.com>
|
||||
*/
|
||||
|
|
@ -10,6 +11,8 @@
|
|||
#include <linux/rmap.h>
|
||||
#include <linux/interval_tree_generic.h>
|
||||
|
||||
/* File-backed interval tree (address_space->i_mmap) */
|
||||
|
||||
INTERVAL_TREE_DEFINE(struct vm_area_struct, shared.rb,
|
||||
unsigned long, shared.rb_subtree_last,
|
||||
vma_start_pgoff, vma_last_pgoff, /* empty */, vma_interval_tree)
|
||||
|
|
@ -23,7 +26,7 @@ void vma_interval_tree_insert_after(struct vm_area_struct *node,
|
|||
struct vm_area_struct *parent;
|
||||
unsigned long last = vma_last_pgoff(node);
|
||||
|
||||
VM_BUG_ON_VMA(vma_start_pgoff(node) != vma_start_pgoff(prev), node);
|
||||
VM_WARN_ON_ONCE_VMA(vma_start_pgoff(node) != vma_start_pgoff(prev), node);
|
||||
|
||||
if (!prev->shared.rb.rb_right) {
|
||||
parent = prev;
|
||||
|
|
@ -48,6 +51,8 @@ void vma_interval_tree_insert_after(struct vm_area_struct *node,
|
|||
&vma_interval_tree_augment);
|
||||
}
|
||||
|
||||
/* Anonymous interval tree (anon_vma->rb_root) */
|
||||
|
||||
static inline unsigned long avc_start_pgoff(struct anon_vma_chain *avc)
|
||||
{
|
||||
return vma_start_pgoff(avc->vma);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user