Lines Matching refs:mas
20 MA_STATE(mas, mt, reg, reg); in regcache_maple_read()
25 entry = mas_walk(&mas); in regcache_maple_read()
31 *value = entry[reg - mas.index]; in regcache_maple_read()
42 MA_STATE(mas, mt, reg, reg); in regcache_maple_write()
50 entry = mas_walk(&mas); in regcache_maple_write()
52 entry[reg - mas.index] = val; in regcache_maple_write()
58 mas_set_range(&mas, reg - 1, reg + 1); in regcache_maple_write()
62 lower = mas_find(&mas, reg - 1); in regcache_maple_write()
64 index = mas.index; in regcache_maple_write()
65 lower_sz = (mas.last - mas.index + 1) * sizeof(unsigned long); in regcache_maple_write()
68 upper = mas_find(&mas, reg + 1); in regcache_maple_write()
70 last = mas.last; in regcache_maple_write()
71 upper_sz = (mas.last - mas.index + 1) * sizeof(unsigned long); in regcache_maple_write()
92 mas_lock(&mas); in regcache_maple_write()
94 mas_set_range(&mas, index, last); in regcache_maple_write()
95 ret = mas_store_gfp(&mas, entry, map->alloc_flags); in regcache_maple_write()
97 mas_unlock(&mas); in regcache_maple_write()
111 MA_STATE(mas, mt, min, max); in regcache_maple_drop()
121 mas_lock(&mas); in regcache_maple_drop()
123 mas_for_each(&mas, entry, max) { in regcache_maple_drop()
129 mas_unlock(&mas); in regcache_maple_drop()
132 if (mas.index < min) { in regcache_maple_drop()
133 lower_index = mas.index; in regcache_maple_drop()
137 min - mas.index, sizeof(*lower), in regcache_maple_drop()
145 if (mas.last > max) { in regcache_maple_drop()
147 upper_last = mas.last; in regcache_maple_drop()
149 upper = kmemdup_array(&entry[max - mas.index + 1], in regcache_maple_drop()
150 mas.last - max, sizeof(*upper), in regcache_maple_drop()
159 mas_lock(&mas); in regcache_maple_drop()
160 mas_erase(&mas); in regcache_maple_drop()
164 mas_set_range(&mas, lower_index, lower_last); in regcache_maple_drop()
165 ret = mas_store_gfp(&mas, lower, map->alloc_flags); in regcache_maple_drop()
172 mas_set_range(&mas, upper_index, upper_last); in regcache_maple_drop()
173 ret = mas_store_gfp(&mas, upper, map->alloc_flags); in regcache_maple_drop()
181 mas_unlock(&mas); in regcache_maple_drop()
190 struct ma_state *mas, in regcache_maple_sync_block() argument
198 mas_pause(mas); in regcache_maple_sync_block()
216 entry[r - mas->index]); in regcache_maple_sync_block()
226 entry[r - mas->index]); in regcache_maple_sync_block()
243 MA_STATE(mas, mt, min, max); in regcache_maple_sync()
254 mas_for_each(&mas, entry, max) { in regcache_maple_sync()
255 for (r = max(mas.index, lmin); r <= min(mas.last, lmax); r++) { in regcache_maple_sync()
256 v = entry[r - mas.index]; in regcache_maple_sync()
269 ret = regcache_maple_sync_block(map, entry, &mas, in regcache_maple_sync()
277 ret = regcache_maple_sync_block(map, entry, &mas, in regcache_maple_sync()
296 MA_STATE(mas, mt, 0, UINT_MAX); in regcache_maple_exit()
303 mas_lock(&mas); in regcache_maple_exit()
304 mas_for_each(&mas, entry, UINT_MAX) in regcache_maple_exit()
307 mas_unlock(&mas); in regcache_maple_exit()
319 MA_STATE(mas, mt, first, last); in regcache_maple_insert_block()
330 mas_lock(&mas); in regcache_maple_insert_block()
332 mas_set_range(&mas, map->reg_defaults[first].reg, in regcache_maple_insert_block()
334 ret = mas_store_gfp(&mas, entry, map->alloc_flags); in regcache_maple_insert_block()
336 mas_unlock(&mas); in regcache_maple_insert_block()