diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0052-block-add-blk_queue_dead.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0052-block-add-blk_queue_dead.patch | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0052-block-add-blk_queue_dead.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0052-block-add-blk_queue_dead.patch new file mode 100644 index 00000000..d9de19d2 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0052-block-add-blk_queue_dead.patch | |||
@@ -0,0 +1,140 @@ | |||
1 | From 964e5928138f09dc58d9d507ce51a6adccfdb7e0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tejun Heo <tj@kernel.org> | ||
3 | Date: Wed, 14 Dec 2011 00:33:37 +0100 | ||
4 | Subject: [PATCH 52/73] block: add blk_queue_dead() | ||
5 | |||
6 | commit 34f6055c80285e4efb3f602a9119db75239744dc upstream. | ||
7 | |||
8 | There are a number of QUEUE_FLAG_DEAD tests. Add blk_queue_dead() | ||
9 | macro and use it. | ||
10 | |||
11 | This patch doesn't introduce any functional difference. | ||
12 | |||
13 | Signed-off-by: Tejun Heo <tj@kernel.org> | ||
14 | Signed-off-by: Jens Axboe <axboe@kernel.dk> | ||
15 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
16 | --- | ||
17 | block/blk-core.c | 6 +++--- | ||
18 | block/blk-exec.c | 2 +- | ||
19 | block/blk-sysfs.c | 4 ++-- | ||
20 | block/blk-throttle.c | 4 ++-- | ||
21 | block/blk.h | 2 +- | ||
22 | include/linux/blkdev.h | 1 + | ||
23 | 6 files changed, 10 insertions(+), 9 deletions(-) | ||
24 | |||
25 | diff --git a/block/blk-core.c b/block/blk-core.c | ||
26 | index 15de223..49d9e91 100644 | ||
27 | --- a/block/blk-core.c | ||
28 | +++ b/block/blk-core.c | ||
29 | @@ -607,7 +607,7 @@ EXPORT_SYMBOL(blk_init_allocated_queue); | ||
30 | |||
31 | int blk_get_queue(struct request_queue *q) | ||
32 | { | ||
33 | - if (likely(!test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) { | ||
34 | + if (likely(!blk_queue_dead(q))) { | ||
35 | kobject_get(&q->kobj); | ||
36 | return 0; | ||
37 | } | ||
38 | @@ -754,7 +754,7 @@ static struct request *get_request(struct request_queue *q, int rw_flags, | ||
39 | const bool is_sync = rw_is_sync(rw_flags) != 0; | ||
40 | int may_queue; | ||
41 | |||
42 | - if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) | ||
43 | + if (unlikely(blk_queue_dead(q))) | ||
44 | return NULL; | ||
45 | |||
46 | may_queue = elv_may_queue(q, rw_flags); | ||
47 | @@ -874,7 +874,7 @@ static struct request *get_request_wait(struct request_queue *q, int rw_flags, | ||
48 | struct io_context *ioc; | ||
49 | struct request_list *rl = &q->rq; | ||
50 | |||
51 | - if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) | ||
52 | + if (unlikely(blk_queue_dead(q))) | ||
53 | return NULL; | ||
54 | |||
55 | prepare_to_wait_exclusive(&rl->wait[is_sync], &wait, | ||
56 | diff --git a/block/blk-exec.c b/block/blk-exec.c | ||
57 | index a1ebceb..6053285 100644 | ||
58 | --- a/block/blk-exec.c | ||
59 | +++ b/block/blk-exec.c | ||
60 | @@ -50,7 +50,7 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk, | ||
61 | { | ||
62 | int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK; | ||
63 | |||
64 | - if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) { | ||
65 | + if (unlikely(blk_queue_dead(q))) { | ||
66 | rq->errors = -ENXIO; | ||
67 | if (rq->end_io) | ||
68 | rq->end_io(rq, rq->errors); | ||
69 | diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c | ||
70 | index e7f9f65..f0b2ca8 100644 | ||
71 | --- a/block/blk-sysfs.c | ||
72 | +++ b/block/blk-sysfs.c | ||
73 | @@ -425,7 +425,7 @@ queue_attr_show(struct kobject *kobj, struct attribute *attr, char *page) | ||
74 | if (!entry->show) | ||
75 | return -EIO; | ||
76 | mutex_lock(&q->sysfs_lock); | ||
77 | - if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)) { | ||
78 | + if (blk_queue_dead(q)) { | ||
79 | mutex_unlock(&q->sysfs_lock); | ||
80 | return -ENOENT; | ||
81 | } | ||
82 | @@ -447,7 +447,7 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr, | ||
83 | |||
84 | q = container_of(kobj, struct request_queue, kobj); | ||
85 | mutex_lock(&q->sysfs_lock); | ||
86 | - if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)) { | ||
87 | + if (blk_queue_dead(q)) { | ||
88 | mutex_unlock(&q->sysfs_lock); | ||
89 | return -ENOENT; | ||
90 | } | ||
91 | diff --git a/block/blk-throttle.c b/block/blk-throttle.c | ||
92 | index 4553245..5eed6a7 100644 | ||
93 | --- a/block/blk-throttle.c | ||
94 | +++ b/block/blk-throttle.c | ||
95 | @@ -310,7 +310,7 @@ static struct throtl_grp * throtl_get_tg(struct throtl_data *td) | ||
96 | struct request_queue *q = td->queue; | ||
97 | |||
98 | /* no throttling for dead queue */ | ||
99 | - if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) | ||
100 | + if (unlikely(blk_queue_dead(q))) | ||
101 | return NULL; | ||
102 | |||
103 | rcu_read_lock(); | ||
104 | @@ -335,7 +335,7 @@ static struct throtl_grp * throtl_get_tg(struct throtl_data *td) | ||
105 | spin_lock_irq(q->queue_lock); | ||
106 | |||
107 | /* Make sure @q is still alive */ | ||
108 | - if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) { | ||
109 | + if (unlikely(blk_queue_dead(q))) { | ||
110 | kfree(tg); | ||
111 | return NULL; | ||
112 | } | ||
113 | diff --git a/block/blk.h b/block/blk.h | ||
114 | index 3f6551b..e38691d 100644 | ||
115 | --- a/block/blk.h | ||
116 | +++ b/block/blk.h | ||
117 | @@ -85,7 +85,7 @@ static inline struct request *__elv_next_request(struct request_queue *q) | ||
118 | q->flush_queue_delayed = 1; | ||
119 | return NULL; | ||
120 | } | ||
121 | - if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags) || | ||
122 | + if (unlikely(blk_queue_dead(q)) || | ||
123 | !q->elevator->ops->elevator_dispatch_fn(q, 0)) | ||
124 | return NULL; | ||
125 | } | ||
126 | diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h | ||
127 | index 0ed1eb0..ff039f0 100644 | ||
128 | --- a/include/linux/blkdev.h | ||
129 | +++ b/include/linux/blkdev.h | ||
130 | @@ -481,6 +481,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) | ||
131 | |||
132 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | ||
133 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | ||
134 | +#define blk_queue_dead(q) test_bit(QUEUE_FLAG_DEAD, &(q)->queue_flags) | ||
135 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | ||
136 | #define blk_queue_noxmerges(q) \ | ||
137 | test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags) | ||
138 | -- | ||
139 | 1.7.7.6 | ||
140 | |||