diff --git a/ebtree/ebmbtree.h b/ebtree/ebmbtree.h index 48dc13082..5ab115d0f 100644 --- a/ebtree/ebmbtree.h +++ b/ebtree/ebmbtree.h @@ -373,7 +373,9 @@ __ebmb_insert(struct eb_root *root, struct ebmb_node *new, unsigned int len) /* Find the first occurence of the longest prefix matching a key in the * tree . It's the caller's responsibility to ensure that key is at - * least as long as the keys in the tree. If none can be found, return NULL. + * least as long as the keys in the tree. Note that this can be ensured by + * having a byte at the end of which cannot be part of any prefix, typically + * the trailing zero for a string. If none can be found, return NULL. */ static forceinline struct ebmb_node *__ebmb_lookup_longest(struct eb_root *root, const void *x) { @@ -465,7 +467,9 @@ static forceinline struct ebmb_node *__ebmb_lookup_longest(struct eb_root *root, /* Find the first occurence of a prefix matching a key of BITS in the * tree . It's the caller's responsibility to ensure that key is at - * least as long as the keys in the tree. If none can be found, return NULL. + * least as long as the keys in the tree. Note that this can be ensured by + * having a byte at the end of which cannot be part of any prefix, typically + * the trailing zero for a string. If none can be found, return NULL. */ static forceinline struct ebmb_node *__ebmb_lookup_prefix(struct eb_root *root, const void *x, unsigned int pfx) {