block: fix inconsistency in I/O stat accounting code

This forces in_flight to be zero when turning off or on the I/O stat
accounting and stops updating I/O stats in attempt_merge() when
accounting is turned off.

Signed-off-by: Jerome Marchand <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Jerome Marchand 2009-03-27 10:31:51 +01:00 • committed by Jens Axboe
commit 26308eab69
6 changed files with 33 additions and 26 deletions

View file

@ -209,10 +209,14 @@ static ssize_t queue_iostats_store(struct request_queue *q, const char *page,
ssize_t ret = queue_var_store(&stats, page, count);
spin_lock_irq(q->queue_lock);
elv_quisce_start(q);
if (stats)
queue_flag_set(QUEUE_FLAG_IO_STAT, q);
else
queue_flag_clear(QUEUE_FLAG_IO_STAT, q);
elv_quisce_end(q);
spin_unlock_irq(q->queue_lock);
return ret;