Searched refs:element_nr (Results 1 - 3 of 3) sorted by relevance

/linux-4.4.14/include/linux/
H A Dflex_array.h70 int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src,
72 int flex_array_clear(struct flex_array *fa, unsigned int element_nr);
73 void *flex_array_get(struct flex_array *fa, unsigned int element_nr);
79 void *flex_array_get_ptr(struct flex_array *fa, unsigned int element_nr);
/linux-4.4.14/lib/
H A Dflex_array.c120 unsigned int element_nr) fa_element_to_part_nr()
127 return reciprocal_divide(element_nr, fa->reciprocal_elems); fa_element_to_part_nr()
156 unsigned int element_nr, index_inside_part()
161 part_offset = element_nr - part_nr * fa->elems_per_part; index_inside_part()
182 * flex_array_put - copy data into the array at @element_nr
184 * @element_nr: index of the position in which to insert
198 int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, flex_array_put() argument
205 if (element_nr >= fa->total_nr_elements) flex_array_put()
212 part_nr = fa_element_to_part_nr(fa, element_nr); flex_array_put()
217 dst = &part->elements[index_inside_part(fa, element_nr, part_nr)]; flex_array_put()
224 * flex_array_clear - clear element in array at @element_nr
226 * @element_nr: index of the position to clear.
230 int flex_array_clear(struct flex_array *fa, unsigned int element_nr) flex_array_clear() argument
236 if (element_nr >= fa->total_nr_elements) flex_array_clear()
243 part_nr = fa_element_to_part_nr(fa, element_nr); flex_array_clear()
248 dst = &part->elements[index_inside_part(fa, element_nr, part_nr)]; flex_array_clear()
306 * @element_nr: index of the element to fetch from the array
308 * Returns a pointer to the data at index @element_nr. Note
315 void *flex_array_get(struct flex_array *fa, unsigned int element_nr) flex_array_get() argument
322 if (element_nr >= fa->total_nr_elements) flex_array_get()
327 part_nr = fa_element_to_part_nr(fa, element_nr); flex_array_get()
332 return &part->elements[index_inside_part(fa, element_nr, part_nr)]; flex_array_get()
339 * @element_nr: index of the element to fetch from the array
341 * Returns the pointer placed in the flex array at element_nr using
345 void *flex_array_get_ptr(struct flex_array *fa, unsigned int element_nr) flex_array_get_ptr() argument
349 tmp = flex_array_get(fa, element_nr); flex_array_get_ptr()
119 fa_element_to_part_nr(struct flex_array *fa, unsigned int element_nr) fa_element_to_part_nr() argument
155 index_inside_part(struct flex_array *fa, unsigned int element_nr, unsigned int part_nr) index_inside_part() argument
/linux-4.4.14/security/selinux/ss/
H A Dpolicydb.h359 static inline char *sym_name(struct policydb *p, unsigned int sym_num, unsigned int element_nr) sym_name() argument
363 return flex_array_get_ptr(fa, element_nr); sym_name()

Completed in 81 milliseconds