Lines Matching refs:iotlb

28 void vhost_iotlb_map_free(struct vhost_iotlb *iotlb,  in vhost_iotlb_map_free()  argument
31 vhost_iotlb_itree_remove(map, &iotlb->root); in vhost_iotlb_map_free()
34 iotlb->nmaps--; in vhost_iotlb_map_free()
49 int vhost_iotlb_add_range(struct vhost_iotlb *iotlb, in vhost_iotlb_add_range() argument
58 if (iotlb->limit && in vhost_iotlb_add_range()
59 iotlb->nmaps == iotlb->limit && in vhost_iotlb_add_range()
60 iotlb->flags & VHOST_IOTLB_FLAG_RETIRE) { in vhost_iotlb_add_range()
61 map = list_first_entry(&iotlb->list, typeof(*map), link); in vhost_iotlb_add_range()
62 vhost_iotlb_map_free(iotlb, map); in vhost_iotlb_add_range()
75 iotlb->nmaps++; in vhost_iotlb_add_range()
76 vhost_iotlb_itree_insert(map, &iotlb->root); in vhost_iotlb_add_range()
79 list_add_tail(&map->link, &iotlb->list); in vhost_iotlb_add_range()
91 void vhost_iotlb_del_range(struct vhost_iotlb *iotlb, u64 start, u64 last) in vhost_iotlb_del_range() argument
95 while ((map = vhost_iotlb_itree_iter_first(&iotlb->root, in vhost_iotlb_del_range()
97 vhost_iotlb_map_free(iotlb, map); in vhost_iotlb_del_range()
110 struct vhost_iotlb *iotlb = kzalloc(sizeof(*iotlb), GFP_KERNEL); in vhost_iotlb_alloc() local
112 if (!iotlb) in vhost_iotlb_alloc()
115 iotlb->root = RB_ROOT_CACHED; in vhost_iotlb_alloc()
116 iotlb->limit = limit; in vhost_iotlb_alloc()
117 iotlb->nmaps = 0; in vhost_iotlb_alloc()
118 iotlb->flags = flags; in vhost_iotlb_alloc()
119 INIT_LIST_HEAD(&iotlb->list); in vhost_iotlb_alloc()
121 return iotlb; in vhost_iotlb_alloc()
129 void vhost_iotlb_reset(struct vhost_iotlb *iotlb) in vhost_iotlb_reset() argument
131 vhost_iotlb_del_range(iotlb, 0ULL, 0ULL - 1); in vhost_iotlb_reset()
139 void vhost_iotlb_free(struct vhost_iotlb *iotlb) in vhost_iotlb_free() argument
141 if (iotlb) { in vhost_iotlb_free()
142 vhost_iotlb_reset(iotlb); in vhost_iotlb_free()
143 kfree(iotlb); in vhost_iotlb_free()
155 vhost_iotlb_itree_first(struct vhost_iotlb *iotlb, u64 start, u64 last) in vhost_iotlb_itree_first() argument
157 return vhost_iotlb_itree_iter_first(&iotlb->root, start, last); in vhost_iotlb_itree_first()