/* Generic associative array implementation.
*
* See Documentation/core-api/assoc_array.rst for information.
*
* Copyright (C) 2013 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public Licence
* as published by the Free Software Foundation; either version
* 2 of the Licence, or (at your option) any later version.
*/
//#define DEBUG
#include <linux/rcupdate.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/assoc_array_priv.h>
/*
* Iterate over an associative array. The caller must hold the RCU read lock
* or better.
*/
static int assoc_array_subtree_iterate(const struct assoc_array_ptr *root,
const struct assoc_array_ptr *stop,
int (*iterator)(const void *leaf,
void *iterator_data),
void *iterator_data)
{
const struct assoc_array_shortcut *shortcut;
const struct assoc_array_node *node;
const struct assoc_array_ptr *cursor, *ptr, *parent;
|