aboutsummaryrefslogtreecommitdiffstats
path: root/block/scsi_ioctl.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-04-29 03:54:36 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-04-29 08:48:55 -0400
commit992b5bceee447a32ef2d617730ae0d03c063eedd (patch)
treecf8a457afc939b9d6040b809382e8a45adc9eee1 /block/scsi_ioctl.c
parent4917fa292558593d36b2880977ea206f7727dbe5 (diff)
block: no need to initialize rq->cmd with blk_get_request
blk_get_request initializes rq->cmd (rq_init does) so the users don't need to do that. The purpose of this patch is to remove sizeof(rq->cmd) and &rq->cmd, as a preparation for large command support, which changes rq->cmd from the static array to a pointer. sizeof(rq->cmd) will not make sense and &rq->cmd won't work. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Alasdair G Kergon <agk@redhat.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/scsi_ioctl.c')
-rw-r--r--block/scsi_ioctl.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index a2c3a936ebf9..ffa3720e6ca0 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -217,8 +217,6 @@ EXPORT_SYMBOL_GPL(blk_verify_command);
217static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq, 217static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
218 struct sg_io_hdr *hdr, int has_write_perm) 218 struct sg_io_hdr *hdr, int has_write_perm)
219{ 219{
220 memset(rq->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */
221
222 if (copy_from_user(rq->cmd, hdr->cmdp, hdr->cmd_len)) 220 if (copy_from_user(rq->cmd, hdr->cmdp, hdr->cmd_len))
223 return -EFAULT; 221 return -EFAULT;
224 if (blk_verify_command(rq->cmd, has_write_perm)) 222 if (blk_verify_command(rq->cmd, has_write_perm))
@@ -531,7 +529,6 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk,
531 rq->data_len = 0; 529 rq->data_len = 0;
532 rq->extra_len = 0; 530 rq->extra_len = 0;
533 rq->timeout = BLK_DEFAULT_SG_TIMEOUT; 531 rq->timeout = BLK_DEFAULT_SG_TIMEOUT;
534 memset(rq->cmd, 0, sizeof(rq->cmd));
535 rq->cmd[0] = cmd; 532 rq->cmd[0] = cmd;
536 rq->cmd[4] = data; 533 rq->cmd[4] = data;
537 rq->cmd_len = 6; 534 rq->cmd_len = 6;