summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorMatthew Wilcox <mawilcox@microsoft.com>2017-01-17 00:41:29 +0300
committerMatthew Wilcox <mawilcox@microsoft.com>2017-02-14 05:44:04 +0300
commit1293d5c5f54d5118fbb34fc94e01ba02fcd25fc1 (patch)
treed2ff3550817eb4110766b56e4a2032e8502a0b33 /tools/testing
parent73bc029b76482260a144219786d19951f561716e (diff)
downloadlinux-1293d5c5f54d5118fbb34fc94e01ba02fcd25fc1.tar.xz
radix-tree: Chain preallocated nodes through ->parent
Chaining through the ->private_data member means we have to zero ->private_data after removing preallocated nodes from the list. We're about to initialise ->parent anyway, so we can avoid zeroing it. Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/radix-tree/linux.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c
index 94bcdb992bbf..cf48c8473f48 100644
--- a/tools/testing/radix-tree/linux.c
+++ b/tools/testing/radix-tree/linux.c
@@ -35,9 +35,9 @@ void *kmem_cache_alloc(struct kmem_cache *cachep, int flags)
if (cachep->nr_objs) {
cachep->nr_objs--;
node = cachep->objs;
- cachep->objs = node->private_data;
+ cachep->objs = node->parent;
pthread_mutex_unlock(&cachep->lock);
- node->private_data = NULL;
+ node->parent = NULL;
} else {
pthread_mutex_unlock(&cachep->lock);
node = malloc(cachep->size);
@@ -64,7 +64,7 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
} else {
struct radix_tree_node *node = objp;
cachep->nr_objs++;
- node->private_data = cachep->objs;
+ node->parent = cachep->objs;
cachep->objs = node;
}
pthread_mutex_unlock(&cachep->lock);