Skip to content

Commit

Permalink
block: use blk_rq_init() to initialize the request
Browse files Browse the repository at this point in the history
Any path needs to call it to initialize the request.

This is a preparation for large command support, which needs to
initialize the request in a proper way (that is, just doing a memset()
will not work).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
FUJITA Tomonori authored and Jens Axboe committed Apr 29, 2008
1 parent 2a4aa30 commit 4f54eec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ static int nbd_ioctl(struct inode *inode, struct file *file,
switch (cmd) {
case NBD_DISCONNECT:
printk(KERN_INFO "%s: NBD_DISCONNECT\n", lo->disk->disk_name);
blk_rq_init(NULL, &sreq);
sreq.cmd_type = REQ_TYPE_SPECIAL;
nbd_cmd(&sreq) = NBD_CMD_DISC;
/*
Expand Down
4 changes: 1 addition & 3 deletions drivers/block/paride/pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,8 @@ static int pd_special_command(struct pd_unit *disk,
struct request rq;
int err = 0;

memset(&rq, 0, sizeof(rq));
rq.errors = 0;
blk_rq_init(NULL, &rq);
rq.rq_disk = disk->gd;
rq.ref_count = 1;
rq.end_io_data = &wait;
rq.end_io = blk_end_sync_rq;
blk_insert_request(disk->gd->queue, &rq, 0, func);
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,7 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
unsigned long flags;
int rtn;

blk_rq_init(NULL, &req);
scmd->request = &req;
memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout));

Expand Down

0 comments on commit 4f54eec

Please sign in to comment.