Lines Matching refs:resv
229 static long region_add(struct resv_map *resv, long f, long t) in region_add() argument
231 struct list_head *head = &resv->regions; in region_add()
234 spin_lock(&resv->lock); in region_add()
264 spin_unlock(&resv->lock); in region_add()
268 static long region_chg(struct resv_map *resv, long f, long t) in region_chg() argument
270 struct list_head *head = &resv->regions; in region_chg()
275 spin_lock(&resv->lock); in region_chg()
286 spin_unlock(&resv->lock); in region_chg()
325 spin_unlock(&resv->lock); in region_chg()
330 spin_unlock(&resv->lock); in region_chg()
334 static long region_truncate(struct resv_map *resv, long end) in region_truncate() argument
336 struct list_head *head = &resv->regions; in region_truncate()
340 spin_lock(&resv->lock); in region_truncate()
365 spin_unlock(&resv->lock); in region_truncate()
369 static long region_count(struct resv_map *resv, long f, long t) in region_count() argument
371 struct list_head *head = &resv->regions; in region_count()
375 spin_lock(&resv->lock); in region_count()
391 spin_unlock(&resv->lock); in region_count()
1437 struct resv_map *resv; in vma_needs_reservation() local
1441 resv = vma_resv_map(vma); in vma_needs_reservation()
1442 if (!resv) in vma_needs_reservation()
1446 chg = region_chg(resv, idx, idx + 1); in vma_needs_reservation()
1456 struct resv_map *resv; in vma_commit_reservation() local
1459 resv = vma_resv_map(vma); in vma_commit_reservation()
1460 if (!resv) in vma_commit_reservation()
1464 region_add(resv, idx, idx + 1); in vma_commit_reservation()
2543 struct resv_map *resv = vma_resv_map(vma); in hugetlb_vm_op_open() local
2553 if (resv && is_vma_resv_set(vma, HPAGE_RESV_OWNER)) in hugetlb_vm_op_open()
2554 kref_get(&resv->refs); in hugetlb_vm_op_open()
2560 struct resv_map *resv = vma_resv_map(vma); in hugetlb_vm_op_close() local
2565 if (!resv || !is_vma_resv_set(vma, HPAGE_RESV_OWNER)) in hugetlb_vm_op_close()
2571 reserve = (end - start) - region_count(resv, start, end); in hugetlb_vm_op_close()
2573 kref_put(&resv->refs, resv_map_release); in hugetlb_vm_op_close()