From: FUJITA Tomonori Date: Tue, 29 Apr 2008 07:54:35 +0000 (+0200) Subject: block: no need to initialize rq->cmd in prepare_flush_fn hook X-Git-Tag: v2.6.26-rc1~372^2~7 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4917fa292558593d36b2880977ea206f7727dbe5;p=linux-2.6-omap-h63xx.git block: no need to initialize rq->cmd in prepare_flush_fn hook The block layer initializes rq->cmd (queue_flush calls rq_init) so prepare_flush_fn hooks don't need to do that. The purpose of this patch is to remove sizeof(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. Signed-off-by: FUJITA Tomonori Cc: Geert Uytterhoeven Cc: James Bottomley Cc: Jens Axboe Signed-off-by: Jens Axboe --- diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index 78e9ea73a31..d797e209951 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c @@ -405,7 +405,6 @@ static void ps3disk_prepare_flush(struct request_queue *q, struct request *req) dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__); - memset(req->cmd, 0, sizeof(req->cmd)); req->cmd_type = REQ_TYPE_FLUSH; } diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 3cea17dd5db..01cefbb2d53 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -860,7 +860,6 @@ static int sd_sync_cache(struct scsi_disk *sdkp) static void sd_prepare_flush(struct request_queue *q, struct request *rq) { - memset(rq->cmd, 0, sizeof(rq->cmd)); rq->cmd_type = REQ_TYPE_BLOCK_PC; rq->timeout = SD_TIMEOUT; rq->cmd[0] = SYNCHRONIZE_CACHE;