Scroll to navigation

IDR_PRE_GET(9) Basic Kernel Library Functions IDR_PRE_GET(9)

NAME

idr_pre_get - reserve resources for idr allocation

SYNOPSIS

int idr_pre_get(struct idr * idp, gfp_t gfp_mask);

ARGUMENTS

idp
idr handle
gfp_mask
memory allocation flags

DESCRIPTION

This function should be called prior to calling the idr_get_new* functions. It preallocates enough memory to satisfy the worst possible allocation. The caller should pass in GFP_KERNEL if possible. This of course requires that no spinning locks be held.
If the system is REALLY out of memory this function returns 0, otherwise 1.

COPYRIGHT

March 2016 Kernel Hackers Manual 3.2.