radix tree test suite: Remove __item_insert

Inline it into its one caller

Signed-off-by: Matthew Wilcox <willy@infradead.org>
This commit is contained in:
Matthew Wilcox
2018-09-12 12:52:45 -04:00
parent bcfa4b7211
commit 9076b33d7d
2 changed files with 1 additions and 7 deletions

View File

@@ -25,11 +25,6 @@ int item_tag_get(struct radix_tree_root *root, unsigned long index, int tag)
return radix_tree_tag_get(root, index, tag); return radix_tree_tag_get(root, index, tag);
} }
int __item_insert(struct radix_tree_root *root, struct item *item)
{
return __radix_tree_insert(root, item->index, item->order, item);
}
struct item *item_create(unsigned long index, unsigned int order) struct item *item_create(unsigned long index, unsigned int order)
{ {
struct item *ret = malloc(sizeof(*ret)); struct item *ret = malloc(sizeof(*ret));
@@ -43,7 +38,7 @@ int item_insert_order(struct radix_tree_root *root, unsigned long index,
unsigned order) unsigned order)
{ {
struct item *item = item_create(index, order); struct item *item = item_create(index, order);
int err = __item_insert(root, item); int err = __radix_tree_insert(root, item->index, item->order, item);
if (err) if (err)
free(item); free(item);
return err; return err;

View File

@@ -11,7 +11,6 @@ struct item {
}; };
struct item *item_create(unsigned long index, unsigned int order); struct item *item_create(unsigned long index, unsigned int order);
int __item_insert(struct radix_tree_root *root, struct item *item);
int item_insert(struct radix_tree_root *root, unsigned long index); int item_insert(struct radix_tree_root *root, unsigned long index);
void item_sanity(struct item *item, unsigned long index); void item_sanity(struct item *item, unsigned long index);
void item_free(struct item *item, unsigned long index); void item_free(struct item *item, unsigned long index);