block: remove the blk_execute_rq return value
The function only returns -EIO if rq->errors is non-zero, which is not very useful and lets a large number of callers ignore the return value. Just let the callers figure out their error themselves. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Šī revīzija ir iekļauta:

revīziju iesūtīja
Jens Axboe

vecāks
75a500ef6e
revīzija
b7819b9259
@@ -107,7 +107,8 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
|
||||
memcpy(scsi_req(rq)->cmd, pc->c, 12);
|
||||
if (drive->media == ide_tape)
|
||||
scsi_req(rq)->cmd[13] = REQ_IDETAPE_PC1;
|
||||
error = blk_execute_rq(drive->queue, disk, rq, 0);
|
||||
blk_execute_rq(drive->queue, disk, rq, 0);
|
||||
error = rq->errors ? -EIO : 0;
|
||||
put_req:
|
||||
blk_put_request(rq);
|
||||
return error;
|
||||
|
@@ -452,7 +452,8 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
|
||||
}
|
||||
}
|
||||
|
||||
error = blk_execute_rq(drive->queue, info->disk, rq, 0);
|
||||
blk_execute_rq(drive->queue, info->disk, rq, 0);
|
||||
error = rq->errors ? -EIO : 0;
|
||||
|
||||
if (buffer)
|
||||
*bufflen = scsi_req(rq)->resid_len;
|
||||
|
@@ -307,7 +307,8 @@ int ide_cdrom_reset(struct cdrom_device_info *cdi)
|
||||
scsi_req_init(rq);
|
||||
ide_req(rq)->type = ATA_PRIV_MISC;
|
||||
rq->rq_flags = RQF_QUIET;
|
||||
ret = blk_execute_rq(drive->queue, cd->disk, rq, 0);
|
||||
blk_execute_rq(drive->queue, cd->disk, rq, 0);
|
||||
ret = rq->errors ? -EIO : 0;
|
||||
blk_put_request(rq);
|
||||
/*
|
||||
* A reset will unlock the door. If it was previously locked,
|
||||
|
@@ -173,8 +173,8 @@ int ide_devset_execute(ide_drive_t *drive, const struct ide_devset *setting,
|
||||
*(int *)&scsi_req(rq)->cmd[1] = arg;
|
||||
rq->special = setting->set;
|
||||
|
||||
if (blk_execute_rq(q, NULL, rq, 0))
|
||||
ret = rq->errors;
|
||||
blk_execute_rq(q, NULL, rq, 0);
|
||||
ret = rq->errors;
|
||||
blk_put_request(rq);
|
||||
|
||||
return ret;
|
||||
|
@@ -470,7 +470,6 @@ ide_devset_get(multcount, mult_count);
|
||||
static int set_multcount(ide_drive_t *drive, int arg)
|
||||
{
|
||||
struct request *rq;
|
||||
int error;
|
||||
|
||||
if (arg < 0 || arg > (drive->id[ATA_ID_MAX_MULTSECT] & 0xff))
|
||||
return -EINVAL;
|
||||
@@ -484,7 +483,7 @@ static int set_multcount(ide_drive_t *drive, int arg)
|
||||
|
||||
drive->mult_req = arg;
|
||||
drive->special_flags |= IDE_SFLAG_SET_MULTMODE;
|
||||
error = blk_execute_rq(drive->queue, NULL, rq, 0);
|
||||
blk_execute_rq(drive->queue, NULL, rq, 0);
|
||||
blk_put_request(rq);
|
||||
|
||||
return (drive->mult_count == arg) ? 0 : -EIO;
|
||||
|
@@ -128,7 +128,8 @@ static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg)
|
||||
rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM);
|
||||
scsi_req_init(rq);
|
||||
ide_req(rq)->type = ATA_PRIV_TASKFILE;
|
||||
err = blk_execute_rq(drive->queue, NULL, rq, 0);
|
||||
blk_execute_rq(drive->queue, NULL, rq, 0);
|
||||
err = rq->errors ? -EIO : 0;
|
||||
blk_put_request(rq);
|
||||
|
||||
return err;
|
||||
@@ -227,8 +228,8 @@ static int generic_drive_reset(ide_drive_t *drive)
|
||||
ide_req(rq)->type = ATA_PRIV_MISC;
|
||||
scsi_req(rq)->cmd_len = 1;
|
||||
scsi_req(rq)->cmd[0] = REQ_DRIVE_RESET;
|
||||
if (blk_execute_rq(drive->queue, NULL, rq, 1))
|
||||
ret = rq->errors;
|
||||
blk_execute_rq(drive->queue, NULL, rq, 1);
|
||||
ret = rq->errors;
|
||||
blk_put_request(rq);
|
||||
return ret;
|
||||
}
|
||||
|
@@ -37,7 +37,8 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout)
|
||||
scsi_req(rq)->cmd_len = 1;
|
||||
ide_req(rq)->type = ATA_PRIV_MISC;
|
||||
rq->special = &timeout;
|
||||
rc = blk_execute_rq(q, NULL, rq, 1);
|
||||
blk_execute_rq(q, NULL, rq, 1);
|
||||
rc = rq->errors ? -EIO : 0;
|
||||
blk_put_request(rq);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
@@ -27,7 +27,8 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
|
||||
mesg.event = PM_EVENT_FREEZE;
|
||||
rqpm.pm_state = mesg.event;
|
||||
|
||||
ret = blk_execute_rq(drive->queue, NULL, rq, 0);
|
||||
blk_execute_rq(drive->queue, NULL, rq, 0);
|
||||
ret = rq->errors ? -EIO : 0;
|
||||
blk_put_request(rq);
|
||||
|
||||
if (ret == 0 && ide_port_acpi(hwif)) {
|
||||
|
@@ -452,8 +452,8 @@ int ide_raw_taskfile(ide_drive_t *drive, struct ide_cmd *cmd, u8 *buf,
|
||||
rq->special = cmd;
|
||||
cmd->rq = rq;
|
||||
|
||||
error = blk_execute_rq(drive->queue, NULL, rq, 0);
|
||||
|
||||
blk_execute_rq(drive->queue, NULL, rq, 0);
|
||||
error = rq->errors ? -EIO : 0;
|
||||
put_req:
|
||||
blk_put_request(rq);
|
||||
return error;
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user