We only need the stats lock (aka preempt_disable()) for updating the
states, not for looking up or dropping the hd_struct reference.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
update_io_ticks(part, jiffies, true);
part_stat_inc(part, ios[sgrp]);
part_stat_add(part, nsecs[sgrp], now - req->start_time_ns);
+ part_stat_unlock();
hd_struct_put(part);
- part_stat_unlock();
}
}
if (!blk_do_io_stat(rq))
return;
- part_stat_lock();
rq->part = disk_map_sector_rcu(rq->rq_disk, blk_rq_pos(rq));
+
+ part_stat_lock();
update_io_ticks(rq->part, jiffies, false);
part_stat_unlock();
}
if (blk_do_io_stat(req)) {
part_stat_lock();
part_stat_inc(req->part, merges[op_stat_group(req_op(req))]);
- hd_struct_put(req->part);
part_stat_unlock();
+
+ hd_struct_put(req->part);
}
}