summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/genhd.c2
-rw-r--r--block/ll_rw_blk.c7
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)
*/
void add_disk(struct gendisk *disk)
{
- get_device(disk->driverfs_dev);
disk->flags |= GENHD_FL_UP;
blk_register_region(MKDEV(disk->major, disk->first_minor),
disk->minors, NULL, exact_match, exact_lock, disk);
@@ -428,7 +427,6 @@ static struct attribute * default_attrs[] = {
static void disk_release(struct kobject * kobj)
{
struct gendisk *disk = to_disk(kobj);
- put_device(disk->driverfs_dev);
kfree(disk->random);
kfree(disk->part);
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)
if (unlikely(laptop_mode) && blk_fs_request(req))
laptop_io_completion();
- if (disk && blk_fs_request(req)) {
+ /*
+ * Account IO completion. bar_rq isn't accounted as a normal
+ * IO on queueing nor completion. Accounting the containing
+ * request is enough.
+ */
+ if (disk && blk_fs_request(req) && req != &req->q->bar_rq) {
unsigned long duration = jiffies - req->start_time;
const int rw = rq_data_dir(req);