---
name: "get_request"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/get_request"
---

# get\_request(9)

get a free request

## NAME

get\_request - get a free request

## SYNOPSIS

**struct request \* get\_request(struct request\_queue \*** *q***, int** *op***, int** *op\_flags***, struct bio \*** *bio***, gfp\_t** *gfp\_mask***);**

## ARGUMENTS

*q*

request\_queue to allocate request from

*op*

REQ\_OP\_READ/REQ\_OP\_WRITE

*op\_flags*

rq\_flag\_bits

*bio*

bio to allocate request for (can be **NULL**)

*gfp\_mask*

allocation mask

## DESCRIPTION

Get a free request from *q*. If **\_\_GFP\_DIRECT\_RECLAIM** is set in *gfp\_mask*, this function keeps retrying under memory pressure and fails iff *q* is dead.

Must be called with *q*-\>queue\_lock held and, Returns ERR\_PTR on failure, with *q*-\>queue\_lock held. Returns request pointer on success, with *q*-\>queue\_lock \*not held\*.

## COPYRIGHT
