Merge branch 'cleanups' into next
[firefly-linux-kernel-4.4.55.git] / block / blk-core.c
index 2358fc5de5a4d01de85456e5b6a1ff3cdc261da1..775c8516abf5fe5b083416e3be5f07e969ec6f93 100644 (file)
@@ -38,7 +38,7 @@ static int __make_request(struct request_queue *q, struct bio *bio);
 /*
  * For the allocated request tables
  */
-struct kmem_cache *request_cachep;
+static struct kmem_cache *request_cachep;
 
 /*
  * For queue allocation
@@ -127,6 +127,7 @@ void rq_init(struct request_queue *q, struct request *rq)
        rq->nr_hw_segments = 0;
        rq->ioprio = 0;
        rq->special = NULL;
+       rq->raw_data_len = 0;
        rq->buffer = NULL;
        rq->tag = -1;
        rq->errors = 0;
@@ -1219,10 +1220,6 @@ static inline void blk_partition_remap(struct bio *bio)
 
        if (bio_sectors(bio) && bdev != bdev->bd_contains) {
                struct hd_struct *p = bdev->bd_part;
-               const int rw = bio_data_dir(bio);
-
-               p->sectors[rw] += bio_sectors(bio);
-               p->ios[rw]++;
 
                bio->bi_sector += p->start_sect;
                bio->bi_bdev = bdev->bd_contains;
@@ -2019,6 +2016,7 @@ void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
        rq->hard_cur_sectors = rq->current_nr_sectors;
        rq->hard_nr_sectors = rq->nr_sectors = bio_sectors(bio);
        rq->buffer = bio_data(bio);
+       rq->raw_data_len = bio->bi_size;
        rq->data_len = bio->bi_size;
 
        rq->bio = rq->biotail = bio;