|
@@ -1739,6 +1739,34 @@ void bio_check_pages_dirty(struct bio *bio)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void generic_start_io_acct(int rw, unsigned long sectors,
|
|
|
+ struct hd_struct *part)
|
|
|
+{
|
|
|
+ int cpu = part_stat_lock();
|
|
|
+
|
|
|
+ part_round_stats(cpu, part);
|
|
|
+ part_stat_inc(cpu, part, ios[rw]);
|
|
|
+ part_stat_add(cpu, part, sectors[rw], sectors);
|
|
|
+ part_inc_in_flight(part, rw);
|
|
|
+
|
|
|
+ part_stat_unlock();
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(generic_start_io_acct);
|
|
|
+
|
|
|
+void generic_end_io_acct(int rw, struct hd_struct *part,
|
|
|
+ unsigned long start_time)
|
|
|
+{
|
|
|
+ unsigned long duration = jiffies - start_time;
|
|
|
+ int cpu = part_stat_lock();
|
|
|
+
|
|
|
+ part_stat_add(cpu, part, ticks[rw], duration);
|
|
|
+ part_round_stats(cpu, part);
|
|
|
+ part_dec_in_flight(part, rw);
|
|
|
+
|
|
|
+ part_stat_unlock();
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(generic_end_io_acct);
|
|
|
+
|
|
|
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
|
|
|
void bio_flush_dcache_pages(struct bio *bi)
|
|
|
{
|