diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/genhd.c | 2 | ||||
-rw-r--r-- | block/ll_rw_blk.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/block/genhd.c b/block/genhd.c index d96572589621..5a8d3bf02f17 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -182,7 +182,6 @@ static int exact_lock(dev_t dev, void *data) | |||
182 | */ | 182 | */ |
183 | void add_disk(struct gendisk *disk) | 183 | void add_disk(struct gendisk *disk) |
184 | { | 184 | { |
185 | get_device(disk->driverfs_dev); | ||
186 | disk->flags |= GENHD_FL_UP; | 185 | disk->flags |= GENHD_FL_UP; |
187 | blk_register_region(MKDEV(disk->major, disk->first_minor), | 186 | blk_register_region(MKDEV(disk->major, disk->first_minor), |
188 | disk->minors, NULL, exact_match, exact_lock, disk); | 187 | disk->minors, NULL, exact_match, exact_lock, disk); |
@@ -428,7 +427,6 @@ static struct attribute * default_attrs[] = { | |||
428 | static void disk_release(struct kobject * kobj) | 427 | static void disk_release(struct kobject * kobj) |
429 | { | 428 | { |
430 | struct gendisk *disk = to_disk(kobj); | 429 | struct gendisk *disk = to_disk(kobj); |
431 | put_device(disk->driverfs_dev); | ||
432 | kfree(disk->random); | 430 | kfree(disk->random); |
433 | kfree(disk->part); | 431 | kfree(disk->part); |
434 | free_disk_stats(disk); | 432 | free_disk_stats(disk); |
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index eac48bec1479..7eb36c53f4b7 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -3452,7 +3452,12 @@ void end_that_request_last(struct request *req, int uptodate) | |||
3452 | if (unlikely(laptop_mode) && blk_fs_request(req)) | 3452 | if (unlikely(laptop_mode) && blk_fs_request(req)) |
3453 | laptop_io_completion(); | 3453 | laptop_io_completion(); |
3454 | 3454 | ||
3455 | if (disk && blk_fs_request(req)) { | 3455 | /* |
3456 | * Account IO completion. bar_rq isn't accounted as a normal | ||
3457 | * IO on queueing nor completion. Accounting the containing | ||
3458 | * request is enough. | ||
3459 | */ | ||
3460 | if (disk && blk_fs_request(req) && req != &req->q->bar_rq) { | ||
3456 | unsigned long duration = jiffies - req->start_time; | 3461 | unsigned long duration = jiffies - req->start_time; |
3457 | const int rw = rq_data_dir(req); | 3462 | const int rw = rq_data_dir(req); |
3458 | 3463 | ||