607
608 if (root) {
609 if (adjust_next)
610 vma_prio_tree_insert(next, root);
611 vma_prio_tree_insert(vma, root);
612 flush_dcache_mmap_unlock(mapping);
613 }
614
615 if (remove_next) {
616
617
618
619
620 __vma_unlink(mm, next, vma);
621 if (file)
622 __remove_shared_vm_struct(next, file, mapping);
623 if (next->anon_vma)
624 __anon_vma_merge(vma, next);
625 } else if (insert) {
626
627
628
629
630
631 __insert_vm_struct(mm, insert);
632 }
633
634 if (anon_vma)
635 spin_unlock(&anon_vma->lock);
636 if (mapping)
637 spin_unlock(&mapping->i_mmap_lock);
638
639 if (remove_next) {
640 if (file) {
641 fput(file);
642 if (next->vm_flags & VM_EXECUTABLE)
643 removed_exe_file_vma(mm);
644 }
645 mm->map_count--;
646 mpol_put(vma_policy(next));
647 kmem_cache_free(vm_area_cachep, next);