Blame view
include/linux/iocontext.h
1.97 KB
fd0928df9 ioprio: move io p... |
1 2 |
#ifndef IOCONTEXT_H #define IOCONTEXT_H |
4ac845a2e block: cfq: make ... |
3 |
#include <linux/radix-tree.h> |
34e6bbf23 cfq-iosched: fix ... |
4 |
#include <linux/rcupdate.h> |
4ac845a2e block: cfq: make ... |
5 |
|
fd0928df9 ioprio: move io p... |
6 |
struct cfq_queue; |
383cd7213 CFQ: move think t... |
7 8 9 10 11 12 13 |
struct cfq_ttime { unsigned long last_end_request; unsigned long ttime_total; unsigned long ttime_samples; unsigned long ttime_mean; }; |
fd0928df9 ioprio: move io p... |
14 |
struct cfq_io_context { |
fd0928df9 ioprio: move io p... |
15 16 17 18 19 |
void *key; struct cfq_queue *cfqq[2]; struct io_context *ioc; |
383cd7213 CFQ: move think t... |
20 |
struct cfq_ttime ttime; |
fd0928df9 ioprio: move io p... |
21 |
|
fd0928df9 ioprio: move io p... |
22 |
struct list_head queue_list; |
ffc4e7595 cfq-iosched: add ... |
23 |
struct hlist_node cic_list; |
fd0928df9 ioprio: move io p... |
24 25 26 |
void (*dtor)(struct io_context *); /* destructor */ void (*exit)(struct io_context *); /* called on task exit */ |
34e6bbf23 cfq-iosched: fix ... |
27 28 |
struct rcu_head rcu_head; |
fd0928df9 ioprio: move io p... |
29 30 31 |
}; /* |
d38ecf935 io context sharin... |
32 33 |
* I/O subsystem state of the associated processes. It is refcounted * and kmalloc'ed. These could be shared between processes. |
fd0928df9 ioprio: move io p... |
34 35 |
*/ struct io_context { |
d9c7d394a block: prevent po... |
36 |
atomic_long_t refcount; |
d38ecf935 io context sharin... |
37 38 39 40 |
atomic_t nr_tasks; /* all the fields below are protected by this lock */ spinlock_t lock; |
fd0928df9 ioprio: move io p... |
41 42 43 |
unsigned short ioprio; unsigned short ioprio_changed; |
67523c48a cgroups: blkio su... |
44 |
#if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE) |
31e4c28d9 blkio: Introduce ... |
45 46 |
unsigned short cgroup_changed; #endif |
fd0928df9 ioprio: move io p... |
47 48 49 |
/* * For request batching */ |
fd0928df9 ioprio: move io p... |
50 |
int nr_batch_requests; /* Number of requests left in the batch */ |
58c24a616 block: remove pad... |
51 |
unsigned long last_waited; /* Time last woken after wait for request */ |
fd0928df9 ioprio: move io p... |
52 |
|
4ac845a2e block: cfq: make ... |
53 |
struct radix_tree_root radix_root; |
ffc4e7595 cfq-iosched: add ... |
54 |
struct hlist_head cic_list; |
4d2deb40b kernel: __rcu ann... |
55 |
void __rcu *ioc_data; |
fd0928df9 ioprio: move io p... |
56 |
}; |
d38ecf935 io context sharin... |
57 58 59 60 61 62 |
static inline struct io_context *ioc_task_link(struct io_context *ioc) { /* * if ref count is zero, don't allow sharing (ioc is going away, it's * a race). */ |
d9c7d394a block: prevent po... |
63 |
if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) { |
cbb4f2646 io context: fix r... |
64 |
atomic_inc(&ioc->nr_tasks); |
d38ecf935 io context sharin... |
65 |
return ioc; |
d237e5c7c io context: incre... |
66 |
} |
d38ecf935 io context sharin... |
67 68 69 |
return NULL; } |
b69f22920 block: Fix io_con... |
70 |
struct task_struct; |
da9cbc873 block: blkdev.h c... |
71 72 |
#ifdef CONFIG_BLOCK int put_io_context(struct io_context *ioc); |
b69f22920 block: Fix io_con... |
73 |
void exit_io_context(struct task_struct *task); |
da9cbc873 block: blkdev.h c... |
74 75 |
struct io_context *get_io_context(gfp_t gfp_flags, int node); struct io_context *alloc_io_context(gfp_t gfp_flags, int node); |
da9cbc873 block: blkdev.h c... |
76 |
#else |
b69f22920 block: Fix io_con... |
77 |
static inline void exit_io_context(struct task_struct *task) |
da9cbc873 block: blkdev.h c... |
78 79 80 81 82 83 84 85 86 |
{ } struct io_context; static inline int put_io_context(struct io_context *ioc) { return 1; } #endif |
fd0928df9 ioprio: move io p... |
87 |
#endif |