Skip to content

Commit 3a08cd5

Browse files
author
Matthew Wilcox
committed
radix tree: Remove multiorder support
All users have now been converted to the XArray. Removing the support reduces code size and ensures new users will use the XArray instead. Signed-off-by: Matthew Wilcox <willy@infradead.org>
1 parent 542980a commit 3a08cd5

5 files changed

Lines changed: 19 additions & 245 deletions

File tree

‎include/linux/radix-tree.h‎

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ static inline bool radix_tree_empty(const struct radix_tree_root *root)
9696
* @next_index: one beyond the last index for this chunk
9797
* @tags: bit-mask for tag-iterating
9898
* @node: node that contains current slot
99-
* @shift: shift for the node that holds our slots
10099
*
101100
* This radix tree iterator works in terms of "chunks" of slots. A chunk is a
102101
* subinterval of slots contained within one radix tree leaf node. It is
@@ -110,20 +109,8 @@ struct radix_tree_iter {
110109
unsigned long next_index;
111110
unsigned long tags;
112111
struct radix_tree_node *node;
113-
#ifdef CONFIG_RADIX_TREE_MULTIORDER
114-
unsigned int shift;
115-
#endif
116112
};
117113

118-
static inline unsigned int iter_shift(const struct radix_tree_iter *iter)
119-
{
120-
#ifdef CONFIG_RADIX_TREE_MULTIORDER
121-
return iter->shift;
122-
#else
123-
return 0;
124-
#endif
125-
}
126-
127114
/**
128115
* Radix-tree synchronization
129116
*
@@ -230,13 +217,8 @@ static inline int radix_tree_exception(void *arg)
230217
return unlikely((unsigned long)arg & RADIX_TREE_ENTRY_MASK);
231218
}
232219

233-
int __radix_tree_insert(struct radix_tree_root *, unsigned long index,
234-
unsigned order, void *);
235-
static inline int radix_tree_insert(struct radix_tree_root *root,
236-
unsigned long index, void *entry)
237-
{
238-
return __radix_tree_insert(root, index, 0, entry);
239-
}
220+
int radix_tree_insert(struct radix_tree_root *, unsigned long index,
221+
void *);
240222
void *__radix_tree_lookup(const struct radix_tree_root *, unsigned long index,
241223
struct radix_tree_node **nodep, void __rcu ***slotp);
242224
void *radix_tree_lookup(const struct radix_tree_root *, unsigned long);
@@ -384,7 +366,7 @@ void __rcu **radix_tree_iter_retry(struct radix_tree_iter *iter)
384366
static inline unsigned long
385367
__radix_tree_iter_add(struct radix_tree_iter *iter, unsigned long slots)
386368
{
387-
return iter->index + (slots << iter_shift(iter));
369+
return iter->index + slots;
388370
}
389371

390372
/**
@@ -409,20 +391,8 @@ void __rcu **__must_check radix_tree_iter_resume(void __rcu **slot,
409391
static __always_inline long
410392
radix_tree_chunk_size(struct radix_tree_iter *iter)
411393
{
412-
return (iter->next_index - iter->index) >> iter_shift(iter);
413-
}
414-
415-
#ifdef CONFIG_RADIX_TREE_MULTIORDER
416-
void __rcu **__radix_tree_next_slot(void __rcu **slot,
417-
struct radix_tree_iter *iter, unsigned flags);
418-
#else
419-
/* Can't happen without sibling entries, but the compiler can't tell that */
420-
static inline void __rcu **__radix_tree_next_slot(void __rcu **slot,
421-
struct radix_tree_iter *iter, unsigned flags)
422-
{
423-
return slot;
394+
return iter->next_index - iter->index;
424395
}
425-
#endif
426396

427397
/**
428398
* radix_tree_next_slot - find next slot in chunk
@@ -482,8 +452,6 @@ static __always_inline void __rcu **radix_tree_next_slot(void __rcu **slot,
482452
return NULL;
483453

484454
found:
485-
if (unlikely(radix_tree_is_internal_node(rcu_dereference_raw(*slot))))
486-
return __radix_tree_next_slot(slot, iter, flags);
487455
return slot;
488456
}
489457

‎lib/Kconfig‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,6 @@ config XARRAY_MULTI
405405
Support entries which occupy multiple consecutive indices in the
406406
XArray.
407407

408-
config RADIX_TREE_MULTIORDER
409-
bool
410-
select XARRAY_MULTI
411-
412408
config ASSOCIATIVE_ARRAY
413409
bool
414410
help

0 commit comments

Comments
 (0)