---
name: "idr_pre_get"
section: "9"
platform: "linux"
package: "linux-manual-3.2"
version: "3.2.78-1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/idr_pre_get"
---

# idr\_pre\_get(9)

reserve resources for idr allocation

## 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
