Lines Matching refs:new
49 * we'll continue to use the old array and just won't see the new one.
73 * add new eventfds without ever blocking readers from accessing the array.
78 * We allocate a brand new one-larger array, copy the old one and add our new
79 * element. Then we make the lg eventfd pointer point to the new array.
89 struct lg_eventfd_map *new, *old = lg->eventfds;
99 * Replace the old array with the new one, carefully: others can
102 new = kmalloc(sizeof(*new) + sizeof(new->map[0]) * (old->num + 1),
104 if (!new)
108 memcpy(new->map, old->map, sizeof(old->map[0]) * old->num);
109 new->num = old->num;
111 /* Now append new entry. */
112 new->map[new->num].addr = addr;
113 new->map[new->num].event = eventfd_ctx_fdget(fd);
114 if (IS_ERR(new->map[new->num].event)) {
115 int err = PTR_ERR(new->map[new->num].event);
116 kfree(new);
119 new->num++;
122 * Now put new one in place: rcu_assign_pointer() is a fancy way of
123 * doing "lg->eventfds = new", but it uses memory barriers to make
124 * absolutely sure that the contents of "new" written above is nailed
130 rcu_assign_pointer(lg->eventfds, new);