Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
blk-map.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/bio.h>
#include <linux/blkdev.h>
#include <scsi/sg.h>
#include "blk.h"

Go to the source code of this file.

Functions

int blk_rq_append_bio (struct request_queue *q, struct request *rq, struct bio *bio)
 
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)
 
 EXPORT_SYMBOL (blk_rq_map_user)
 
int blk_rq_map_user_iov (struct request_queue *q, struct request *rq, struct rq_map_data *map_data, struct sg_iovec *iov, int iov_count, unsigned int len, gfp_t gfp_mask)
 
 EXPORT_SYMBOL (blk_rq_map_user_iov)
 
int blk_rq_unmap_user (struct bio *bio)
 
 EXPORT_SYMBOL (blk_rq_unmap_user)
 
int blk_rq_map_kern (struct request_queue *q, struct request *rq, void *kbuf, unsigned int len, gfp_t gfp_mask)
 
 EXPORT_SYMBOL (blk_rq_map_kern)
 

Function Documentation

int blk_rq_append_bio ( struct request_queue q,
struct request rq,
struct bio *  bio 
)

Definition at line 12 of file blk-map.c.

int blk_rq_map_kern ( struct request_queue q,
struct request rq,
void kbuf,
unsigned int  len,
gfp_t  gfp_mask 
)

blk_rq_map_kern - map kernel data to a request, for REQ_TYPE_BLOCK_PC usage : request queue where request should be inserted : request to fill : the kernel buffer : length of user data : memory allocation flags

Description: Data will be mapped directly if possible. Otherwise a bounce buffer is used. Can be called multple times to append multple buffers.

Definition at line 291 of file blk-map.c.

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 
)

blk_rq_map_user - map user data to a request, for REQ_TYPE_BLOCK_PC usage : request queue where request should be inserted : request structure to fill : pointer to the rq_map_data holding pages (if necessary) : the user buffer : length of user data : 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.

Definition at line 110 of file blk-map.c.

int blk_rq_map_user_iov ( struct request_queue q,
struct request rq,
struct rq_map_data *  map_data,
struct sg_iovec iov,
int  iov_count,
unsigned int  len,
gfp_t  gfp_mask 
)

blk_rq_map_user_iov - map user data to a request, for REQ_TYPE_BLOCK_PC usage : request queue where request should be inserted : request to map data to : pointer to the rq_map_data holding pages (if necessary) : pointer to the iovec : number of elements in the iovec : I/O byte count : 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.

Definition at line 190 of file blk-map.c.

int blk_rq_unmap_user ( struct bio *  bio)

blk_rq_unmap_user - unmap a request with user data : start of bio list

Description: Unmap a rq previously mapped by blk_rq_map_user(). The caller must supply the original rq->bio from the blk_rq_map_user() return, since the I/O completion may have changed rq->bio.

Definition at line 255 of file blk-map.c.

EXPORT_SYMBOL ( blk_rq_map_user  )
EXPORT_SYMBOL ( blk_rq_map_user_iov  )
EXPORT_SYMBOL ( blk_rq_unmap_user  )
EXPORT_SYMBOL ( blk_rq_map_kern  )