• Home
  • Raw
  • Download

Lines Matching refs:add

130 	struct grant_map *add;  in gntdev_alloc_map()  local
133 add = kzalloc(sizeof(struct grant_map), GFP_KERNEL); in gntdev_alloc_map()
134 if (NULL == add) in gntdev_alloc_map()
137 add->grants = kcalloc(count, sizeof(add->grants[0]), GFP_KERNEL); in gntdev_alloc_map()
138 add->map_ops = kcalloc(count, sizeof(add->map_ops[0]), GFP_KERNEL); in gntdev_alloc_map()
139 add->unmap_ops = kcalloc(count, sizeof(add->unmap_ops[0]), GFP_KERNEL); in gntdev_alloc_map()
140 add->kmap_ops = kcalloc(count, sizeof(add->kmap_ops[0]), GFP_KERNEL); in gntdev_alloc_map()
141 add->pages = kcalloc(count, sizeof(add->pages[0]), GFP_KERNEL); in gntdev_alloc_map()
142 if (NULL == add->grants || in gntdev_alloc_map()
143 NULL == add->map_ops || in gntdev_alloc_map()
144 NULL == add->unmap_ops || in gntdev_alloc_map()
145 NULL == add->kmap_ops || in gntdev_alloc_map()
146 NULL == add->pages) in gntdev_alloc_map()
149 if (alloc_xenballooned_pages(count, add->pages, false /* lowmem */)) in gntdev_alloc_map()
153 add->map_ops[i].handle = -1; in gntdev_alloc_map()
154 add->unmap_ops[i].handle = -1; in gntdev_alloc_map()
155 add->kmap_ops[i].handle = -1; in gntdev_alloc_map()
158 add->index = 0; in gntdev_alloc_map()
159 add->count = count; in gntdev_alloc_map()
160 atomic_set(&add->users, 1); in gntdev_alloc_map()
162 return add; in gntdev_alloc_map()
165 gntdev_free_map(add); in gntdev_alloc_map()
169 static void gntdev_add_map(struct gntdev_priv *priv, struct grant_map *add) in gntdev_add_map() argument
174 if (add->index + add->count < map->index) { in gntdev_add_map()
175 list_add_tail(&add->next, &map->next); in gntdev_add_map()
178 add->index = map->index + map->count; in gntdev_add_map()
180 list_add_tail(&add->next, &priv->maps); in gntdev_add_map()
183 gntdev_print_maps(priv, "[new]", add->index); in gntdev_add_map()