*参照元 [#yb6db1a3] #backlinks *説明 [#cf849f98] -パス: [[linux-2.6.33/]] -パス: [[linux-2.6.33/mm/mmap.c]] -FIXME: これは何? --説明 **引数 [#d50ef4fa] -struct mm_struct *mm -- --[[linux-2.6.33/mm_struct]] -unsigned long addr -- **返り値 [#ja2fae3c] -struct vm_area_struct * -- --[[linux-2.6.33/vm_area_struct]] **参考 [#l2250044] *実装 [#u911900a] /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) { struct vm_area_struct *vma = NULL; if (mm) { /* Check the cache first. */ /* (Cache hit rate is typically around 35%.) */ vma = mm->mmap_cache; if (!(vma && vma->vm_end > addr && vma->vm_start <= addr)) { struct rb_node * rb_node; - --[[linux-2.6.33/rb_node]] rb_node = mm->mm_rb.rb_node; vma = NULL; while (rb_node) { struct vm_area_struct * vma_tmp; vma_tmp = rb_entry(rb_node, struct vm_area_struct, vm_rb); - --[[linux-2.6.33/rb_entry()]] if (vma_tmp->vm_end > addr) { vma = vma_tmp; if (vma_tmp->vm_start <= addr) break; rb_node = rb_node->rb_left; } else rb_node = rb_node->rb_right; } if (vma) mm->mmap_cache = vma; } } return vma; } EXPORT_SYMBOL(find_vma); -特にライセンスを区別せずにシンボルをエクスポートする。 --[[linux-2.6.33/EXPORT_SYMBOL()]] *コメント [#g5e0b2b8]