Skip to content

Commit 731ec49

Browse files
htejunJens Axboe
authored andcommitted
block: kill rq->data
Now that all block request data transfer is done via bio, rq->data isn't used. Kill it. While at it, make the roles of rq->special and buffer clear. [ Impact: drop now unncessary field from struct request ] Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Boaz Harrosh <bharrosh@panasas.com>
1 parent ec24751 commit 731ec49

5 files changed

Lines changed: 7 additions & 11 deletions

File tree

‎block/blk-core.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,9 @@ void blk_dump_rq_flags(struct request *rq, char *msg)
189189
(unsigned long long)rq->sector,
190190
rq->nr_sectors,
191191
rq->current_nr_sectors);
192-
printk(KERN_INFO " bio %p, biotail %p, buffer %p, data %p, len %u\n",
192+
printk(KERN_INFO " bio %p, biotail %p, buffer %p, len %u\n",
193193
rq->bio, rq->biotail,
194-
rq->buffer, rq->data,
195-
rq->data_len);
194+
rq->buffer, rq->data_len);
196195

197196
if (blk_pc_request(rq)) {
198197
printk(KERN_INFO " cdb: ");

‎block/blk-map.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ int blk_rq_map_user(struct request_queue *q, struct request *rq,
156156
if (!bio_flagged(bio, BIO_USER_MAPPED))
157157
rq->cmd_flags |= REQ_COPY_USER;
158158

159-
rq->buffer = rq->data = NULL;
159+
rq->buffer = NULL;
160160
return 0;
161161
unmap_rq:
162162
blk_rq_unmap_user(bio);
@@ -235,7 +235,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
235235
blk_queue_bounce(q, &bio);
236236
bio_get(bio);
237237
blk_rq_bio_prep(q, rq, bio);
238-
rq->buffer = rq->data = NULL;
238+
rq->buffer = NULL;
239239
return 0;
240240
}
241241
EXPORT_SYMBOL(blk_rq_map_user_iov);
@@ -313,7 +313,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
313313

314314
blk_rq_bio_prep(q, rq, bio);
315315
blk_queue_bounce(q, &rq->bio);
316-
rq->buffer = rq->data = NULL;
316+
rq->buffer = NULL;
317317
return 0;
318318
}
319319
EXPORT_SYMBOL(blk_rq_map_kern);

‎block/scsi_ioctl.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk,
500500

501501
rq = blk_get_request(q, WRITE, __GFP_WAIT);
502502
rq->cmd_type = REQ_TYPE_BLOCK_PC;
503-
rq->data = NULL;
504503
rq->data_len = 0;
505504
rq->extra_len = 0;
506505
rq->timeout = BLK_DEFAULT_SG_TIMEOUT;

‎drivers/scsi/scsi_lib.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,6 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req)
10881088
return ret;
10891089
} else {
10901090
BUG_ON(req->data_len);
1091-
BUG_ON(req->data);
10921091

10931092
memset(&cmd->sdb, 0, sizeof(cmd->sdb));
10941093
req->buffer = NULL;

‎include/linux/blkdev.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ struct request {
211211

212212
unsigned short ioprio;
213213

214-
void *special;
215-
char *buffer;
214+
void *special; /* opaque pointer available for LLD use */
215+
char *buffer; /* kaddr of the current segment if available */
216216

217217
int tag;
218218
int errors;
@@ -229,7 +229,6 @@ struct request {
229229
unsigned int data_len;
230230
unsigned int extra_len; /* length of alignment and padding */
231231
unsigned int sense_len;
232-
void *data;
233232
void *sense;
234233

235234
unsigned long deadline;

0 commit comments

Comments
 (0)