summaryrefslogtreecommitdiff
path: root/block/bio.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/bio.c')
-rw-r--r--block/bio.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/block/bio.c b/block/bio.c
index 1594804fe8bc..9c101a0572ca 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1396,13 +1396,16 @@ void generic_start_io_acct(struct request_queue *q, int op,
unsigned long sectors, struct hd_struct *part)
{
const int sgrp = op_stat_group(op);
+ int rw = op_is_write(op);
part_stat_lock();
update_io_ticks(part, jiffies, false);
part_stat_inc(part, ios[sgrp]);
part_stat_add(part, sectors[sgrp], sectors);
- part_inc_in_flight(q, part, op_is_write(op));
+ part_stat_local_inc(part, in_flight[rw]);
+ if (part->partno)
+ part_stat_local_inc(&part_to_disk(part)->part0, in_flight[rw]);
part_stat_unlock();
}
@@ -1414,12 +1417,15 @@ void generic_end_io_acct(struct request_queue *q, int req_op,
unsigned long now = jiffies;
unsigned long duration = now - start_time;
const int sgrp = op_stat_group(req_op);
+ int rw = op_is_write(req_op);
part_stat_lock();
update_io_ticks(part, now, true);
part_stat_add(part, nsecs[sgrp], jiffies_to_nsecs(duration));
- part_dec_in_flight(q, part, op_is_write(req_op));
+ part_stat_local_dec(part, in_flight[rw]);
+ if (part->partno)
+ part_stat_local_dec(&part_to_disk(part)->part0, in_flight[rw]);
part_stat_unlock();
}