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

Go to the source code of this file.

Functions

void get_io_context (struct io_context *ioc)
 
 EXPORT_SYMBOL (get_io_context)
 
void put_io_context (struct io_context *ioc)
 
 EXPORT_SYMBOL (put_io_context)
 
void put_io_context_active (struct io_context *ioc)
 
void exit_io_context (struct task_struct *task)
 
void ioc_clear_queue (struct request_queue *q)
 
int create_task_io_context (struct task_struct *task, gfp_t gfp_flags, int node)
 
struct io_contextget_task_io_context (struct task_struct *task, gfp_t gfp_flags, int node)
 
 EXPORT_SYMBOL (get_task_io_context)
 
struct io_cqioc_lookup_icq (struct io_context *ioc, struct request_queue *q)
 
 EXPORT_SYMBOL (ioc_lookup_icq)
 
struct io_cqioc_create_icq (struct io_context *ioc, struct request_queue *q, gfp_t gfp_mask)
 
 subsys_initcall (blk_ioc_init)
 

Function Documentation

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

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

void exit_io_context ( struct task_struct task)

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

EXPORT_SYMBOL ( get_io_context  )
EXPORT_SYMBOL ( put_io_context  )
EXPORT_SYMBOL ( get_task_io_context  )
EXPORT_SYMBOL ( ioc_lookup_icq  )
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.

struct io_context* get_task_io_context ( struct task_struct task,
gfp_t  gfp_flags,
int  node 
)
read

get_task_io_context - get io_context of a task : task of interest : allocation flags, used if allocation is necessary : allocation node, used if allocation is necessary

Return io_context of . If it doesn't exist, it is created with and . The returned io_context has its reference count incremented.

This function always goes through task_lock() and it's better to use current->io_context + get_io_context() for current.

Definition at line 288 of file blk-ioc.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.

void put_io_context ( struct io_context ioc)

put_io_context - put a reference of io_context : io_context to put

Decrement reference count of and release it if the count reaches zero.

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

void put_io_context_active ( struct io_context ioc)

put_io_context_active - put active reference on ioc : ioc of interest

Undo get_io_context_active(). If active reference reaches zero after put, can never issue further IOs and ioscheds are notified.

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

subsys_initcall ( blk_ioc_init  )