dm.c (52b544bd386688177c41d53e748111c29d0ccc98) | dm.c (ddcf35d397976421a4ec1d0d00fbcc027a8cb034) |
---|---|
1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm-core.h" --- 595 unchanged lines hidden (view full) --- 604static void start_io_acct(struct dm_io *io) 605{ 606 struct mapped_device *md = io->md; 607 struct bio *bio = io->orig_bio; 608 int rw = bio_data_dir(bio); 609 610 io->start_time = jiffies; 611 | 1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm-core.h" --- 595 unchanged lines hidden (view full) --- 604static void start_io_acct(struct dm_io *io) 605{ 606 struct mapped_device *md = io->md; 607 struct bio *bio = io->orig_bio; 608 int rw = bio_data_dir(bio); 609 610 io->start_time = jiffies; 611 |
612 generic_start_io_acct(md->queue, rw, bio_sectors(bio), &dm_disk(md)->part0); | 612 generic_start_io_acct(md->queue, bio_op(bio), bio_sectors(bio), 613 &dm_disk(md)->part0); |
613 614 atomic_set(&dm_disk(md)->part0.in_flight[rw], 615 atomic_inc_return(&md->pending[rw])); 616 617 if (unlikely(dm_stats_used(&md->stats))) 618 dm_stats_account_io(&md->stats, bio_data_dir(bio), 619 bio->bi_iter.bi_sector, bio_sectors(bio), 620 false, 0, &io->stats_aux); 621} 622 623static void end_io_acct(struct dm_io *io) 624{ 625 struct mapped_device *md = io->md; 626 struct bio *bio = io->orig_bio; 627 unsigned long duration = jiffies - io->start_time; 628 int pending; 629 int rw = bio_data_dir(bio); 630 | 614 615 atomic_set(&dm_disk(md)->part0.in_flight[rw], 616 atomic_inc_return(&md->pending[rw])); 617 618 if (unlikely(dm_stats_used(&md->stats))) 619 dm_stats_account_io(&md->stats, bio_data_dir(bio), 620 bio->bi_iter.bi_sector, bio_sectors(bio), 621 false, 0, &io->stats_aux); 622} 623 624static void end_io_acct(struct dm_io *io) 625{ 626 struct mapped_device *md = io->md; 627 struct bio *bio = io->orig_bio; 628 unsigned long duration = jiffies - io->start_time; 629 int pending; 630 int rw = bio_data_dir(bio); 631 |
631 generic_end_io_acct(md->queue, rw, &dm_disk(md)->part0, io->start_time); | 632 generic_end_io_acct(md->queue, bio_op(bio), &dm_disk(md)->part0, 633 io->start_time); |
632 633 if (unlikely(dm_stats_used(&md->stats))) 634 dm_stats_account_io(&md->stats, bio_data_dir(bio), 635 bio->bi_iter.bi_sector, bio_sectors(bio), 636 true, duration, &io->stats_aux); 637 638 /* 639 * After this is decremented the bio must not be touched if it is --- 2543 unchanged lines hidden --- | 634 635 if (unlikely(dm_stats_used(&md->stats))) 636 dm_stats_account_io(&md->stats, bio_data_dir(bio), 637 bio->bi_iter.bi_sector, bio_sectors(bio), 638 true, duration, &io->stats_aux); 639 640 /* 641 * After this is decremented the bio must not be touched if it is --- 2543 unchanged lines hidden --- |