dm.c (f524d9c95fab54783d0038f7a3e8c014d5b56857) | dm.c (b879f915bc48a18d4f4462729192435bb0f17052) |
---|---|
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" --- 475 unchanged lines hidden (view full) --- 484} 485EXPORT_SYMBOL_GPL(dm_start_time_ns_from_clone); 486 487static void start_io_acct(struct dm_io *io) 488{ 489 struct mapped_device *md = io->md; 490 struct bio *bio = io->orig_bio; 491 | 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" --- 475 unchanged lines hidden (view full) --- 484} 485EXPORT_SYMBOL_GPL(dm_start_time_ns_from_clone); 486 487static void start_io_acct(struct dm_io *io) 488{ 489 struct mapped_device *md = io->md; 490 struct bio *bio = io->orig_bio; 491 |
492 io->start_time = bio_start_io_acct(bio); | 492 bio_start_io_acct_time(bio, io->start_time); |
493 if (unlikely(dm_stats_used(&md->stats))) 494 dm_stats_account_io(&md->stats, bio_data_dir(bio), 495 bio->bi_iter.bi_sector, bio_sectors(bio), 496 false, 0, &io->stats_aux); 497} 498 499static void end_io_acct(struct mapped_device *md, struct bio *bio, 500 unsigned long start_time, struct dm_stats_aux *stats_aux) --- 29 unchanged lines hidden (view full) --- 530 io = container_of(tio, struct dm_io, tio); 531 io->magic = DM_IO_MAGIC; 532 io->status = 0; 533 atomic_set(&io->io_count, 1); 534 io->orig_bio = bio; 535 io->md = md; 536 spin_lock_init(&io->endio_lock); 537 | 493 if (unlikely(dm_stats_used(&md->stats))) 494 dm_stats_account_io(&md->stats, bio_data_dir(bio), 495 bio->bi_iter.bi_sector, bio_sectors(bio), 496 false, 0, &io->stats_aux); 497} 498 499static void end_io_acct(struct mapped_device *md, struct bio *bio, 500 unsigned long start_time, struct dm_stats_aux *stats_aux) --- 29 unchanged lines hidden (view full) --- 530 io = container_of(tio, struct dm_io, tio); 531 io->magic = DM_IO_MAGIC; 532 io->status = 0; 533 atomic_set(&io->io_count, 1); 534 io->orig_bio = bio; 535 io->md = md; 536 spin_lock_init(&io->endio_lock); 537 |
538 start_io_acct(io); | 538 io->start_time = jiffies; |
539 540 return io; 541} 542 543static void free_io(struct mapped_device *md, struct dm_io *io) 544{ 545 bio_put(&io->tio.clone); 546} --- 930 unchanged lines hidden (view full) --- 1477 GFP_NOIO, &md->queue->bio_split); 1478 ci.io->orig_bio = b; 1479 1480 bio_chain(b, bio); 1481 trace_block_split(b, bio->bi_iter.bi_sector); 1482 submit_bio_noacct(bio); 1483 } 1484 } | 539 540 return io; 541} 542 543static void free_io(struct mapped_device *md, struct dm_io *io) 544{ 545 bio_put(&io->tio.clone); 546} --- 930 unchanged lines hidden (view full) --- 1477 GFP_NOIO, &md->queue->bio_split); 1478 ci.io->orig_bio = b; 1479 1480 bio_chain(b, bio); 1481 trace_block_split(b, bio->bi_iter.bi_sector); 1482 submit_bio_noacct(bio); 1483 } 1484 } |
1485 start_io_acct(ci.io); |
|
1485 1486 /* drop the extra reference count */ 1487 dm_io_dec_pending(ci.io, errno_to_blk_status(error)); 1488} 1489 1490static void dm_submit_bio(struct bio *bio) 1491{ 1492 struct mapped_device *md = bio->bi_bdev->bd_disk->private_data; --- 1498 unchanged lines hidden --- | 1486 1487 /* drop the extra reference count */ 1488 dm_io_dec_pending(ci.io, errno_to_blk_status(error)); 1489} 1490 1491static void dm_submit_bio(struct bio *bio) 1492{ 1493 struct mapped_device *md = bio->bi_bdev->bd_disk->private_data; --- 1498 unchanged lines hidden --- |