INIT_LIST_HEAD(&rq->timeout_list);
rq->cpu = -1;
rq->q = q;
- rq->sector = (sector_t) -1;
+ rq->__sector = (sector_t) -1;
INIT_HLIST_NODE(&rq->hash);
RB_CLEAR_NODE(&rq->rb_node);
rq->cmd = rq->__cmd;
req->cmd_flags |= REQ_NOIDLE;
req->errors = 0;
- req->sector = bio->bi_sector;
+ req->__sector = bio->bi_sector;
req->ioprio = bio_prio(bio);
blk_rq_bio_prep(req->q, req, bio);
}
req->biotail->bi_next = bio;
req->biotail = bio;
- req->data_len += bytes;
+ req->__data_len += bytes;
req->ioprio = ioprio_best(req->ioprio, prio);
if (!blk_rq_cpu_valid(req))
req->cpu = bio->bi_comp_cpu;
* not touch req->buffer either...
*/
req->buffer = bio_data(bio);
- req->sector = bio->bi_sector;
- req->data_len += bytes;
+ req->__sector = bio->bi_sector;
+ req->__data_len += bytes;
req->ioprio = ioprio_best(req->ioprio, prio);
if (!blk_rq_cpu_valid(req))
req->cpu = bio->bi_comp_cpu;
* can find how many bytes remain in the request
* later.
*/
- req->data_len = 0;
+ req->__data_len = 0;
return false;
}
bio_iovec(bio)->bv_len -= nr_bytes;
}
- req->data_len -= total_bytes;
+ req->__data_len -= total_bytes;
req->buffer = bio_data(req->bio);
/* update sector only for requests with clear definition of sector */
if (blk_fs_request(req) || blk_discard_rq(req))
- req->sector += total_bytes >> 9;
+ req->__sector += total_bytes >> 9;
/*
* If total number of sectors is less than the first segment
*/
if (blk_rq_bytes(req) < blk_rq_cur_bytes(req)) {
printk(KERN_ERR "blk: request botched\n");
- req->data_len = blk_rq_cur_bytes(req);
+ req->__data_len = blk_rq_cur_bytes(req);
}
/* recalculate the number of segments */
rq->nr_phys_segments = bio_phys_segments(q, bio);
rq->buffer = bio_data(bio);
}
- rq->data_len = bio->bi_size;
+ rq->__data_len = bio->bi_size;
rq->bio = rq->biotail = bio;
if (bio->bi_bdev)
enum rq_cmd_type_bits cmd_type;
unsigned long atomic_flags;
- sector_t sector; /* sector cursor */
- unsigned int data_len; /* total data len, don't access directly */
+ /* the following two fields are internal, NEVER access directly */
+ sector_t __sector; /* sector cursor */
+ unsigned int __data_len; /* total data len */
struct bio *bio;
struct bio *biotail;
*/
static inline sector_t blk_rq_pos(const struct request *rq)
{
- return rq->sector;
+ return rq->__sector;
}
static inline unsigned int blk_rq_bytes(const struct request *rq)
{
- return rq->data_len;
+ return rq->__data_len;
}
static inline int blk_rq_cur_bytes(const struct request *rq)