Scroll to navigation

IDR_FOR_EACH(9) Basic Kernel Library Functions IDR_FOR_EACH(9)

NAME

idr_for_each - iterate through all stored pointers

SYNOPSIS

int idr_for_each(const struct idr * idr, int (*fn) (int id, void *p, void *data), void * data);

ARGUMENTS

const struct idr * idr

idr handle

int (*)(int id, void *p, void *data) fn

function to be called for each pointer

void * data

data passed to callback function

DESCRIPTION

The callback function will be called for each entry in idr, passing the id, the pointer and the data pointer passed to this function.

If fn returns anything other than 0, the iteration stops and that value is returned from this function.

idr_for_each can be called concurrently with idr_alloc and idr_remove if protected by RCU. Newly added entries may not be seen and deleted entries may be seen, but adding and removing entries will not cause other entries to be skipped, nor spurious ones to be seen.

COPYRIGHT

June 2017 Kernel Hackers Manual 4.11