aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-05-07 09:09:39 +0200
committerJens Axboe <jens.axboe@oracle.com>2008-05-07 09:09:39 +0200
commitbf0f97025c7306870b86ccd63669aa278e7ec1c2 (patch)
treed8988d1f6d817a1bb31563c9864f616a52c4c0b4
parentc0a18111e571138747a98af18b3a2124df56a0d1 (diff)
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>
-rw-r--r--block/blk-sysfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index e85c4013e8a..304ec73ab82 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -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;
}