diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2017-01-28 17:56:22 +0300 |
---|---|---|
committer | Matthew Wilcox <mawilcox@microsoft.com> | 2017-02-14 00:09:55 +0300 |
commit | 0ac398ef391b53122976325ab6953456ce8e8310 (patch) | |
tree | 99318e48860947c93bb7a230e66834abd67bef7a /include/linux/radix-tree.h | |
parent | 30b888ba950d9f77326b50a4aa2d7d99557d5718 (diff) | |
download | linux-0ac398ef391b53122976325ab6953456ce8e8310.tar.xz |
radix-tree: Add radix_tree_iter_delete
Factor the deletion code out into __radix_tree_delete() and provide a
nice iterator-based wrapper around it. If we free the node, advance
the iterator to avoid reading from freed memory.
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Diffstat (limited to 'include/linux/radix-tree.h')
-rw-r--r-- | include/linux/radix-tree.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 8bf4ef448ce1..05f715cb8062 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h @@ -311,6 +311,8 @@ void __radix_tree_delete_node(struct radix_tree_root *root, struct radix_tree_node *node, radix_tree_update_node_t update_node, void *private); +void radix_tree_iter_delete(struct radix_tree_root *, + struct radix_tree_iter *iter, void **slot); void *radix_tree_delete_item(struct radix_tree_root *, unsigned long, void *); void *radix_tree_delete(struct radix_tree_root *, unsigned long); void radix_tree_clear_tags(struct radix_tree_root *root, |