Commit 421716bc authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

rsxx: use bio_{start,end}_io_acct

Switch rsxx to use the nicer bio accounting helpers.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 24d69293
...@@ -96,20 +96,6 @@ static const struct block_device_operations rsxx_fops = { ...@@ -96,20 +96,6 @@ static const struct block_device_operations rsxx_fops = {
.ioctl = rsxx_blkdev_ioctl, .ioctl = rsxx_blkdev_ioctl,
}; };
static void disk_stats_start(struct rsxx_cardinfo *card, struct bio *bio)
{
generic_start_io_acct(card->queue, bio_op(bio), bio_sectors(bio),
&card->gendisk->part0);
}
static void disk_stats_complete(struct rsxx_cardinfo *card,
struct bio *bio,
unsigned long start_time)
{
generic_end_io_acct(card->queue, bio_op(bio),
&card->gendisk->part0, start_time);
}
static void bio_dma_done_cb(struct rsxx_cardinfo *card, static void bio_dma_done_cb(struct rsxx_cardinfo *card,
void *cb_data, void *cb_data,
unsigned int error) unsigned int error)
...@@ -121,7 +107,7 @@ static void bio_dma_done_cb(struct rsxx_cardinfo *card, ...@@ -121,7 +107,7 @@ static void bio_dma_done_cb(struct rsxx_cardinfo *card,
if (atomic_dec_and_test(&meta->pending_dmas)) { if (atomic_dec_and_test(&meta->pending_dmas)) {
if (!card->eeh_state && card->gendisk) if (!card->eeh_state && card->gendisk)
disk_stats_complete(card, meta->bio, meta->start_time); bio_end_io_acct(meta->bio, meta->start_time);
if (atomic_read(&meta->error)) if (atomic_read(&meta->error))
bio_io_error(meta->bio); bio_io_error(meta->bio);
...@@ -167,10 +153,9 @@ static blk_qc_t rsxx_make_request(struct request_queue *q, struct bio *bio) ...@@ -167,10 +153,9 @@ static blk_qc_t rsxx_make_request(struct request_queue *q, struct bio *bio)
bio_meta->bio = bio; bio_meta->bio = bio;
atomic_set(&bio_meta->error, 0); atomic_set(&bio_meta->error, 0);
atomic_set(&bio_meta->pending_dmas, 0); atomic_set(&bio_meta->pending_dmas, 0);
bio_meta->start_time = jiffies;
if (!unlikely(card->halt)) if (!unlikely(card->halt))
disk_stats_start(card, bio); bio_meta->start_time = bio_start_io_acct(bio);
dev_dbg(CARD_TO_DEV(card), "BIO[%c]: meta: %p addr8: x%llx size: %d\n", dev_dbg(CARD_TO_DEV(card), "BIO[%c]: meta: %p addr8: x%llx size: %d\n",
bio_data_dir(bio) ? 'W' : 'R', bio_meta, bio_data_dir(bio) ? 'W' : 'R', bio_meta,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment