---
name: "blk_rq_map_user"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/blk_rq_map_user"
---

# blk\_rq\_map\_user(9)

map user data to a request, for REQ\_TYPE\_BLOCK\_PC usage

## NAME

blk\_rq\_map\_user - map user data to a request, for REQ\_TYPE\_BLOCK\_PC usage

## SYNOPSIS

**int blk\_rq\_map\_user(struct request\_queue \*** *q***, struct request \*** *rq***, struct rq\_map\_data \*** *map\_data***, void \_\_user \*** *ubuf***, unsigned long** *len***, gfp\_t** *gfp\_mask***);**

## ARGUMENTS

*q*

request queue where request should be inserted

*rq*

request structure to fill

*map\_data*

pointer to the rq\_map\_data holding pages (if necessary)

*ubuf*

the user buffer

*len*

length of user data

*gfp\_mask*

memory allocation flags

## DESCRIPTION

Data will be mapped directly for zero copy I/O, if possible. Otherwise a kernel bounce buffer is used.

A matching **blk\_rq\_unmap\_user** must be issued at the end of I/O, while still in process context.

## NOTE

The mapped bio may need to be bounced through **blk\_queue\_bounce** before being submitted to the device, as pages mapped may be out of reach. It's the callers responsibility to make sure this happens. The original bio must be passed back in to **blk\_rq\_unmap\_user** for proper unmapping.

## COPYRIGHT
