dect
/
linux-2.6
Archived
13
0
Fork 0

block: sysfs store function needs to grab queue_lock and use queue_flag_*()

Concurrency isn't a big deal here since we have requests in flight
at this point, but do the locked variant to set a better example.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
Jens Axboe 2008-05-07 09:09:39 +02:00
parent c0a18111e5
commit bf0f97025c
1 changed files with 4 additions and 2 deletions

View File

@ -146,11 +146,13 @@ static ssize_t queue_nomerges_store(struct request_queue *q, const char *page,
unsigned long nm;
ssize_t ret = queue_var_store(&nm, page, count);
spin_lock_irq(q->queue_lock);
if (nm)
set_bit(QUEUE_FLAG_NOMERGES, &q->queue_flags);
queue_flag_set(QUEUE_FLAG_NOMERGES, q);
else
clear_bit(QUEUE_FLAG_NOMERGES, &q->queue_flags);
queue_flag_clear(QUEUE_FLAG_NOMERGES, q);
spin_unlock_irq(q->queue_lock);
return ret;
}