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

Go to the source code of this file.

Data Structures

struct  throtl_rb_root
 
struct  tg_stats_cpu
 
struct  throtl_grp
 
struct  throtl_data
 

Macros

#define THROTL_RB_ROOT
 
#define rb_entry_tg(node)   rb_entry((node), struct throtl_grp, rb_node)
 
#define THROTL_TG_FNS(name)
 
#define throtl_log_tg(td, tg, fmt, args...)
 
#define throtl_log(td, fmt, args...)   blk_add_trace_msg((td)->queue, "throtl " fmt, ##args)
 

Enumerations

enum  tg_state_flags { THROTL_TG_FLAG_on_rr = 0 }
 

Functions

 THROTL_TG_FNS (on_rr)
 
void blk_throtl_work (struct work_struct *work)
 
bool blk_throtl_bio (struct request_queue *q, struct bio *bio)
 
void blk_throtl_drain (struct request_queue *q) __releases(q-> queue_lock) __acquires(q->queue_lock)
 
int blk_throtl_init (struct request_queue *q)
 
void blk_throtl_exit (struct request_queue *q)
 
 module_init (throtl_init)
 

Macro Definition Documentation

#define rb_entry_tg (   node)    rb_entry((node), struct throtl_grp, rb_node)

Definition at line 41 of file blk-throttle.c.

#define throtl_log (   td,
  fmt,
  args... 
)    blk_add_trace_msg((td)->queue, "throtl " fmt, ##args)

Definition at line 173 of file blk-throttle.c.

#define throtl_log_tg (   td,
  tg,
  fmt,
  args... 
)
Value:
do { \
char __pbuf[128]; \
\
blkg_path(tg_to_blkg(tg), __pbuf, sizeof(__pbuf)); \
blk_add_trace_msg((td)->queue, "throtl %s " fmt, __pbuf, ##args); \
} while (0)

Definition at line 166 of file blk-throttle.c.

#define THROTL_RB_ROOT
Value:
(struct throtl_rb_root) { .rb = RB_ROOT, .left = NULL, \
.count = 0, .min_disptime = 0}

Definition at line 38 of file blk-throttle.c.

#define THROTL_TG_FNS (   name)
Value:
static inline void throtl_mark_tg_##name(struct throtl_grp *tg) \
{ \
(tg)->flags |= (1 << THROTL_TG_FLAG_##name); \
} \
static inline void throtl_clear_tg_##name(struct throtl_grp *tg) \
{ \
(tg)->flags &= ~(1 << THROTL_TG_FLAG_##name); \
} \
static inline int throtl_tg_##name(const struct throtl_grp *tg) \
{ \
return ((tg)->flags & (1 << THROTL_TG_FLAG_##name)) != 0; \
}

Definition at line 150 of file blk-throttle.c.

Enumeration Type Documentation

Enumerator:
THROTL_TG_FLAG_on_rr 

Definition at line 146 of file blk-throttle.c.

Function Documentation

bool blk_throtl_bio ( struct request_queue q,
struct bio *  bio 
)

Definition at line 1107 of file blk-throttle.c.

void blk_throtl_drain ( struct request_queue q) -> queue_lock) __acquires(q->queue_lock)

blk_throtl_drain - drain throttled bios : request_queue to drain throttled bios for

Dispatch all currently throttled bios on through ->make_request_fn().

Definition at line 1205 of file blk-throttle.c.

void blk_throtl_exit ( struct request_queue q)

Definition at line 1257 of file blk-throttle.c.

int blk_throtl_init ( struct request_queue q)

Definition at line 1234 of file blk-throttle.c.

void blk_throtl_work ( struct work_struct work)

Definition at line 914 of file blk-throttle.c.

module_init ( throtl_init  )
THROTL_TG_FNS ( on_rr  )