Scroll to navigation

IDA_GET_NEW_ABOVE(9) Basic Kernel Library Functions IDA_GET_NEW_ABOVE(9)

NAME

ida_get_new_above - allocate new ID above or equal to a start id

SYNOPSIS

int ida_get_new_above(struct ida * ida, int start, int * id);

ARGUMENTS

struct ida * ida

ida handle

int start

id to start search at

int * id

pointer to the allocated handle

DESCRIPTION

Allocate new ID above or equal to start. It should be called with any required locks to ensure that concurrent calls to ida_get_new_above / ida_get_new / ida_remove are not allowed. Consider using ida_simple_get if you do not have complex locking requirements.

If memory is required, it will return -EAGAIN, you should unlock and go back to the ida_pre_get call. If the ida is full, it will return -ENOSPC. On success, it will return 0.

id returns a value in the range start ... 0x7fffffff.

COPYRIGHT

June 2017 Kernel Hackers Manual 4.11