Skip to content

Commit

Permalink
block: sysfs store function needs to grab queue_lock and use queue_fl…
Browse files Browse the repository at this point in the history
…ag_*()

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>
  • Loading branch information
Jens Axboe committed May 7, 2008
1 parent c0a1811 commit bf0f970
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions block/blk-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit bf0f970

Please sign in to comment.