Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions | Variables
blk.h File Reference
#include <linux/idr.h>

Go to the source code of this file.

Macros

#define BLK_BATCH_TIME   (HZ/50UL)
 
#define BLK_BATCH_REQ   32
 
#define ELV_ON_HASH(rq)   (!hlist_unhashed(&(rq)->hash))
 

Enumerations

enum  rq_atomic_flags { REQ_ATOM_COMPLETE = 0 }
 

Functions

int blk_init_rl (struct request_list *rl, struct request_queue *q, gfp_t gfp_mask)
 
void blk_exit_rl (struct request_list *rl)
 
void init_request_from_bio (struct request *req, struct bio *bio)
 
void blk_rq_bio_prep (struct request_queue *q, struct request *rq, struct bio *bio)
 
int blk_rq_append_bio (struct request_queue *q, struct request *rq, struct bio *bio)
 
void blk_queue_bypass_start (struct request_queue *q)
 
void blk_queue_bypass_end (struct request_queue *q)
 
void blk_dequeue_request (struct request *rq)
 
void __blk_queue_free_tags (struct request_queue *q)
 
bool __blk_end_bidi_request (struct request *rq, int error, unsigned int nr_bytes, unsigned int bidi_bytes)
 
void blk_rq_timed_out_timer (unsigned long data)
 
void blk_delete_timer (struct request *)
 
void blk_add_timer (struct request *)
 
void blk_insert_flush (struct request *rq)
 
void blk_abort_flushes (struct request_queue *q)
 
int ll_back_merge_fn (struct request_queue *q, struct request *req, struct bio *bio)
 
int ll_front_merge_fn (struct request_queue *q, struct request *req, struct bio *bio)
 
int attempt_back_merge (struct request_queue *q, struct request *rq)
 
int attempt_front_merge (struct request_queue *q, struct request *rq)
 
int blk_attempt_req_merge (struct request_queue *q, struct request *rq, struct request *next)
 
void blk_recalc_rq_segments (struct request *rq)
 
void blk_rq_set_mixed_merge (struct request *rq)
 
bool blk_rq_merge_ok (struct request *rq, struct bio *bio)
 
int blk_try_merge (struct request *rq, struct bio *bio)
 
void blk_queue_congestion_threshold (struct request_queue *q)
 
int blk_dev_init (void)
 
void get_io_context (struct io_context *ioc)
 
struct io_cqioc_lookup_icq (struct io_context *ioc, struct request_queue *q)
 
struct io_cqioc_create_icq (struct io_context *ioc, struct request_queue *q, gfp_t gfp_mask)
 
void ioc_clear_queue (struct request_queue *q)
 
int create_task_io_context (struct task_struct *task, gfp_t gfp_mask, int node)
 

Variables

struct kmem_cacheblk_requestq_cachep
 
struct kobj_type blk_queue_ktype
 
struct ida blk_queue_ida
 

Macro Definition Documentation

#define BLK_BATCH_REQ   32

Definition at line 10 of file blk.h.

#define BLK_BATCH_TIME   (HZ/50UL)

Definition at line 7 of file blk.h.

#define ELV_ON_HASH (   rq)    (!hlist_unhashed(&(rq)->hash))

Definition at line 64 of file blk.h.

Enumeration Type Documentation

Enumerator:
REQ_ATOM_COMPLETE 

Definition at line 43 of file blk.h.

Function Documentation

bool __blk_end_bidi_request ( struct request rq,
int  error,
unsigned int  nr_bytes,
unsigned int  bidi_bytes 
)

__blk_end_bidi_request - Complete a bidi request with queue lock held : the request to complete : %0 for success, < %0 for error : number of bytes to complete : number of bytes to complete ->next_rq

Description: Identical to blk_end_bidi_request() except that queue lock is assumed to be locked on entry and remains so on return.

Return: false - we are done with this request true - still buffers pending for this request

Definition at line 2488 of file blk-core.c.

void __blk_queue_free_tags ( struct request_queue q)

__blk_queue_free_tags - release tag maintenance info : the request queue for the device

Notes: blk_cleanup_queue() will take care of calling this function, if tagging has been used. So there's no need to call this directly.

Definition at line 65 of file blk-tag.c.

int attempt_back_merge ( struct request_queue q,
struct request rq 
)

Definition at line 479 of file blk-merge.c.

int attempt_front_merge ( struct request_queue q,
struct request rq 
)

Definition at line 489 of file blk-merge.c.

void blk_abort_flushes ( struct request_queue q)

blk_abort_flushes - is being aborted, abort flush requests : request_queue being aborted

To be called from elv_abort_queue(). is being aborted. Prepare all FLUSH/FUA requests for abortion.

CONTEXT: spin_lock_irq(q->queue_lock)

Definition at line 359 of file blk-flush.c.

void blk_add_timer ( struct request req)

blk_add_timer - Start timeout timer for a single request : request that is about to start running.

Notes: Each request has its own timer, and as it is added to the queue, we set up the timer. When the request completes, we cancel the timer.

Definition at line 167 of file blk-timeout.c.

int blk_attempt_req_merge ( struct request_queue q,
struct request rq,
struct request next 
)

Definition at line 499 of file blk-merge.c.

void blk_delete_timer ( struct request )

Definition at line 77 of file blk-timeout.c.

void blk_dequeue_request ( struct request rq)

Definition at line 2120 of file blk-core.c.

int blk_dev_init ( void  )

Definition at line 3033 of file blk-core.c.

void blk_exit_rl ( struct request_list *  rl)

Definition at line 544 of file blk-core.c.

int blk_init_rl ( struct request_list *  rl,
struct request_queue q,
gfp_t  gfp_mask 
)

Definition at line 523 of file blk-core.c.

void blk_insert_flush ( struct request rq)

blk_insert_flush - insert a new FLUSH/FUA request : request to insert

To be called from __elv_add_request() for ELEVATOR_INSERT_FLUSH insertions. is being submitted. Analyze what needs to be done and put it on the right queue.

CONTEXT: spin_lock_irq(q->queue_lock)

Definition at line 298 of file blk-flush.c.

void blk_queue_bypass_end ( struct request_queue q)

blk_queue_bypass_end - leave queue bypass mode : queue of interest

Leave bypass mode and restore the normal queueing behavior.

Definition at line 462 of file blk-core.c.

void blk_queue_bypass_start ( struct request_queue q)

blk_queue_bypass_start - enter queue bypass mode : queue of interest

In bypass mode, only the dispatch FIFO queue of is used. This function makes enter bypass mode and drains all requests which were throttled or issued before. On return, it's guaranteed that no request is being throttled or has ELVPRIV set and blk_queue_bypass() true inside queue or RCU read lock.

Definition at line 439 of file blk-core.c.

void blk_queue_congestion_threshold ( struct request_queue q)

Definition at line 97 of file blk-core.c.

void blk_recalc_rq_segments ( struct request rq)

Definition at line 71 of file blk-merge.c.

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

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

void blk_rq_bio_prep ( struct request_queue q,
struct request rq,
struct bio *  bio 
)

Definition at line 2656 of file blk-core.c.

bool blk_rq_merge_ok ( struct request rq,
struct bio *  bio 
)

Definition at line 505 of file blk-merge.c.

void blk_rq_set_mixed_merge ( struct request rq)

blk_rq_set_mixed_merge - mark a request as mixed merge : request to mark as mixed merge

Description: is about to be mixed merged. Make sure the attributes which can be mixed are set in each bio and mark as mixed merged.

Definition at line 361 of file blk-merge.c.

void blk_rq_timed_out_timer ( unsigned long  data)

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

int blk_try_merge ( struct request rq,
struct bio *  bio 
)

Definition at line 533 of file blk-merge.c.

int create_task_io_context ( struct task_struct task,
gfp_t  gfp_mask,
int  node 
)

Definition at line 235 of file blk-ioc.c.

void get_io_context ( struct io_context ioc)

get_io_context - increment reference count to io_context : io_context to get

Increment reference count to .

Definition at line 25 of file blk-ioc.c.

void init_request_from_bio ( struct request req,
struct bio *  bio 
)

Definition at line 1407 of file blk-core.c.

void ioc_clear_queue ( struct request_queue q)

ioc_clear_queue - break any ioc association with the specified queue : request_queue being cleared

Walk ->icq_list and exit all io_cq's. Must be called with locked.

Definition at line 220 of file blk-ioc.c.

struct io_cq* ioc_create_icq ( struct io_context ioc,
struct request_queue q,
gfp_t  gfp_mask 
)
read

ioc_create_icq - create and link io_cq : io_context of interest : request_queue of interest : allocation mask

Make sure io_cq linking and exists. If icq doesn't exist, they will be created using .

The caller is responsible for ensuring won't go away and is alive and will stay alive until this function returns.

Definition at line 358 of file blk-ioc.c.

struct io_cq* ioc_lookup_icq ( struct io_context ioc,
struct request_queue q 
)
read

ioc_lookup_icq - lookup io_cq from ioc : the associated io_context : the associated request_queue

Look up io_cq associated with - pair from . Must be called with ->queue_lock held.

Definition at line 318 of file blk-ioc.c.

int ll_back_merge_fn ( struct request_queue q,
struct request req,
struct bio *  bio 
)

Definition at line 275 of file blk-merge.c.

int ll_front_merge_fn ( struct request_queue q,
struct request req,
struct bio *  bio 
)

Definition at line 293 of file blk-merge.c.

Variable Documentation

struct ida blk_queue_ida
struct kobj_type blk_queue_ktype

Definition at line 549 of file blk-sysfs.c.

struct kmem_cache* blk_requestq_cachep

Definition at line 54 of file blk-core.c.