/* * Returns pointer to the specified byte @offset within @radix, or NULL if not * allocated
*/ void *__genradix_ptr(struct __genradix *radix, size_t offset)
{ return __genradix_ptr_inlined(radix, offset);
}
EXPORT_SYMBOL(__genradix_ptr);
/* * Returns pointer to the specified byte @offset within @radix, allocating it if * necessary - newly allocated slots are always zeroed out:
*/ void *__genradix_ptr_alloc(struct __genradix *radix, size_t offset, struct genradix_node **preallocated,
gfp_t gfp_mask)
{ struct genradix_root *v = READ_ONCE(radix->root); struct genradix_node *n, *new_node = NULL; unsigned level;
if (preallocated)
swap(new_node, *preallocated);
/* Increase tree depth if necessary: */ while (1) { struct genradix_root *r = v, *new_root;
n = genradix_root_to_node(r);
level = genradix_root_to_depth(r);
if (n && ilog2(offset) < genradix_depth_shift(level)) break;
if (!new_node) {
new_node = genradix_alloc_node(gfp_mask); if (!new_node) return NULL;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.