[PATCH] ->nr_sectors and ->hard_nr_sectors are not used for BLOCK_PC requests
authorJens Axboe <jens.axboe@oracle.com>
Tue, 19 Dec 2006 07:27:31 +0000 (08:27 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 19 Dec 2006 07:27:31 +0000 (08:27 +0100)
It's a file system thing, for block requests the only size used in the
io paths is ->data_len as it is in bytes, not sectors.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/ll_rw_blk.c
drivers/scsi/scsi_lib.c

index 79807dbc306e58b063464a716c8ace72fb110f10..71a78a7e42fd9fb9e341e41634549c016a7b42f7 100644 (file)
@@ -2350,12 +2350,12 @@ static int __blk_rq_map_user(request_queue_t *q, struct request *rq,
        else
                bio = bio_copy_user(q, uaddr, len, reading);
 
-       if (IS_ERR(bio)) {
+       if (IS_ERR(bio))
                return PTR_ERR(bio);
-       }
 
        orig_bio = bio;
        blk_queue_bounce(q, &bio);
+
        /*
         * We link the bounce buffer in and could have to traverse it
         * later so we have to get a ref to prevent it from being freed
@@ -2379,8 +2379,6 @@ static int __blk_rq_map_user(request_queue_t *q, struct request *rq,
                rq->biotail->bi_next = bio;
                rq->biotail = bio;
 
-               rq->nr_sectors += bio_sectors(bio);
-               rq->hard_nr_sectors = rq->nr_sectors;
                rq->data_len += bio->bi_size;
        }
        spin_unlock_irq(q->queue_lock);
index 1748e27501cdee45da304d4cdfd97f1c0ff37372..41a2ea32a300f6e1805118a3c2a707525b14f1f4 100644 (file)
@@ -270,8 +270,6 @@ static int scsi_merge_bio(struct request *rq, struct bio *bio)
        else {
                rq->biotail->bi_next = bio;
                rq->biotail = bio;
-               rq->hard_nr_sectors += bio_sectors(bio);
-               rq->nr_sectors = rq->hard_nr_sectors;
        }
 
        return 0;