Lines Matching refs:resv_map

262 get_file_region_entry_from_cache(struct resv_map *resv, long from, long to)  in get_file_region_entry_from_cache()
292 struct resv_map *resv, in record_hugetlb_cgroup_uncharge_info()
344 static void coalesce_file_region(struct resv_map *resv, struct file_region *rg) in coalesce_file_region()
372 hugetlb_resv_map_add(struct resv_map *map, struct file_region *rg, long from, in hugetlb_resv_map_add()
397 static long add_reservation_in_range(struct resv_map *resv, long f, long t, in add_reservation_in_range()
454 static int allocate_file_region_entries(struct resv_map *resv, in allocate_file_region_entries()
527 static long region_add(struct resv_map *resv, long f, long t, in region_add()
594 static long region_chg(struct resv_map *resv, long f, long t, in region_chg()
630 static void region_abort(struct resv_map *resv, long f, long t, in region_abort()
653 static long region_del(struct resv_map *resv, long f, long t) in region_del()
780 static long region_count(struct resv_map *resv, long f, long t) in region_count()
888 resv_map_set_hugetlb_cgroup_uncharge_info(struct resv_map *resv_map, in resv_map_set_hugetlb_cgroup_uncharge_info() argument
894 resv_map->reservation_counter = NULL; in resv_map_set_hugetlb_cgroup_uncharge_info()
895 resv_map->pages_per_hpage = 0; in resv_map_set_hugetlb_cgroup_uncharge_info()
896 resv_map->css = NULL; in resv_map_set_hugetlb_cgroup_uncharge_info()
898 resv_map->reservation_counter = in resv_map_set_hugetlb_cgroup_uncharge_info()
900 resv_map->pages_per_hpage = pages_per_huge_page(h); in resv_map_set_hugetlb_cgroup_uncharge_info()
901 resv_map->css = &h_cg->css; in resv_map_set_hugetlb_cgroup_uncharge_info()
906 struct resv_map *resv_map_alloc(void) in resv_map_alloc()
908 struct resv_map *resv_map = kmalloc(sizeof(*resv_map), GFP_KERNEL); in resv_map_alloc() local
911 if (!resv_map || !rg) { in resv_map_alloc()
912 kfree(resv_map); in resv_map_alloc()
917 kref_init(&resv_map->refs); in resv_map_alloc()
918 spin_lock_init(&resv_map->lock); in resv_map_alloc()
919 INIT_LIST_HEAD(&resv_map->regions); in resv_map_alloc()
921 resv_map->adds_in_progress = 0; in resv_map_alloc()
928 resv_map_set_hugetlb_cgroup_uncharge_info(resv_map, NULL, NULL); in resv_map_alloc()
930 INIT_LIST_HEAD(&resv_map->region_cache); in resv_map_alloc()
931 list_add(&rg->link, &resv_map->region_cache); in resv_map_alloc()
932 resv_map->region_cache_count = 1; in resv_map_alloc()
934 return resv_map; in resv_map_alloc()
939 struct resv_map *resv_map = container_of(ref, struct resv_map, refs); in resv_map_release() local
940 struct list_head *head = &resv_map->region_cache; in resv_map_release()
944 region_del(resv_map, 0, LONG_MAX); in resv_map_release()
952 VM_BUG_ON(resv_map->adds_in_progress); in resv_map_release()
954 kfree(resv_map); in resv_map_release()
957 static inline struct resv_map *inode_resv_map(struct inode *inode) in inode_resv_map()
967 return (struct resv_map *)(&inode->i_data)->private_data; in inode_resv_map()
970 static struct resv_map *vma_resv_map(struct vm_area_struct *vma) in vma_resv_map()
980 return (struct resv_map *)(get_vma_private_data(vma) & in vma_resv_map()
985 static void set_vma_resv_map(struct vm_area_struct *vma, struct resv_map *map) in set_vma_resv_map()
1038 struct resv_map *reservations = vma_resv_map(vma); in clear_vma_resv_huge_pages()
2494 struct resv_map *resv; in __vma_reservation_common()
4543 struct resv_map *resv = vma_resv_map(vma); in hugetlb_vm_op_open()
4562 struct resv_map *resv = vma_resv_map(vma); in hugetlb_vm_op_close()
6214 struct resv_map *resv_map; in hugetlb_reserve_pages() local
6244 resv_map = inode_resv_map(inode); in hugetlb_reserve_pages()
6246 chg = region_chg(resv_map, from, to, &regions_needed); in hugetlb_reserve_pages()
6250 resv_map = resv_map_alloc(); in hugetlb_reserve_pages()
6251 if (!resv_map) in hugetlb_reserve_pages()
6256 set_vma_resv_map(vma, resv_map); in hugetlb_reserve_pages()
6271 resv_map_set_hugetlb_cgroup_uncharge_info(resv_map, h_cg, h); in hugetlb_reserve_pages()
6302 add = region_add(resv_map, from, to, regions_needed, h, h_cg); in hugetlb_reserve_pages()
6352 region_abort(resv_map, from, to, regions_needed); in hugetlb_reserve_pages()
6354 kref_put(&resv_map->refs, resv_map_release); in hugetlb_reserve_pages()
6362 struct resv_map *resv_map = inode_resv_map(inode); in hugetlb_unreserve_pages() local
6371 if (resv_map) { in hugetlb_unreserve_pages()
6372 chg = region_del(resv_map, start, end); in hugetlb_unreserve_pages()