aboutsummaryrefslogtreecommitdiffstats
path: root/block/as-iosched.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/as-iosched.c')
-rw-r--r--block/as-iosched.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/block/as-iosched.c b/block/as-iosched.c
index 96036846a001..612d64096300 100644
--- a/block/as-iosched.c
+++ b/block/as-iosched.c
@@ -170,11 +170,11 @@ static void free_as_io_context(struct as_io_context *aic)
170 170
171static void as_trim(struct io_context *ioc) 171static void as_trim(struct io_context *ioc)
172{ 172{
173 spin_lock(&ioc->lock); 173 spin_lock_irq(&ioc->lock);
174 if (ioc->aic) 174 if (ioc->aic)
175 free_as_io_context(ioc->aic); 175 free_as_io_context(ioc->aic);
176 ioc->aic = NULL; 176 ioc->aic = NULL;
177 spin_unlock(&ioc->lock); 177 spin_unlock_irq(&ioc->lock);
178} 178}
179 179
180/* Called when the task exits */ 180/* Called when the task exits */
@@ -235,10 +235,12 @@ static void as_put_io_context(struct request *rq)
235 aic = RQ_IOC(rq)->aic; 235 aic = RQ_IOC(rq)->aic;
236 236
237 if (rq_is_sync(rq) && aic) { 237 if (rq_is_sync(rq) && aic) {
238 spin_lock(&aic->lock); 238 unsigned long flags;
239
240 spin_lock_irqsave(&aic->lock, flags);
239 set_bit(AS_TASK_IORUNNING, &aic->state); 241 set_bit(AS_TASK_IORUNNING, &aic->state);
240 aic->last_end_request = jiffies; 242 aic->last_end_request = jiffies;
241 spin_unlock(&aic->lock); 243 spin_unlock_irqrestore(&aic->lock, flags);
242 } 244 }
243 245
244 put_io_context(RQ_IOC(rq)); 246 put_io_context(RQ_IOC(rq));