Commit fcbfffe2 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen

scsi: remove scsi_execute_req_flags

And switch all callers to use scsi_execute instead.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 76aaf87b
...@@ -151,11 +151,9 @@ static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff, ...@@ -151,11 +151,9 @@ static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff,
cdb[1] = MI_REPORT_TARGET_PGS; cdb[1] = MI_REPORT_TARGET_PGS;
put_unaligned_be32(bufflen, &cdb[6]); put_unaligned_be32(bufflen, &cdb[6]);
return scsi_execute_req_flags(sdev, cdb, DMA_FROM_DEVICE, return scsi_execute(sdev, cdb, DMA_FROM_DEVICE, buff, bufflen, NULL,
buff, bufflen, sshdr, sshdr, ALUA_FAILOVER_TIMEOUT * HZ,
ALUA_FAILOVER_TIMEOUT * HZ, ALUA_FAILOVER_RETRIES, req_flags, 0, NULL);
ALUA_FAILOVER_RETRIES, NULL,
req_flags, 0);
} }
/* /*
...@@ -185,11 +183,9 @@ static int submit_stpg(struct scsi_device *sdev, int group_id, ...@@ -185,11 +183,9 @@ static int submit_stpg(struct scsi_device *sdev, int group_id,
cdb[1] = MO_SET_TARGET_PGS; cdb[1] = MO_SET_TARGET_PGS;
put_unaligned_be32(stpg_len, &cdb[6]); put_unaligned_be32(stpg_len, &cdb[6]);
return scsi_execute_req_flags(sdev, cdb, DMA_TO_DEVICE, return scsi_execute(sdev, cdb, DMA_TO_DEVICE, stpg_data, stpg_len, NULL,
stpg_data, stpg_len, sshdr, ALUA_FAILOVER_TIMEOUT * HZ,
sshdr, ALUA_FAILOVER_TIMEOUT * HZ, ALUA_FAILOVER_RETRIES, req_flags, 0, NULL);
ALUA_FAILOVER_RETRIES, NULL,
req_flags, 0);
} }
static struct alua_port_group *alua_find_get_pg(char *id_str, size_t id_size, static struct alua_port_group *alua_find_get_pg(char *id_str, size_t id_size,
......
...@@ -276,10 +276,9 @@ static int send_trespass_cmd(struct scsi_device *sdev, ...@@ -276,10 +276,9 @@ static int send_trespass_cmd(struct scsi_device *sdev,
BUG_ON((len > CLARIION_BUFFER_SIZE)); BUG_ON((len > CLARIION_BUFFER_SIZE));
memcpy(csdev->buffer, page22, len); memcpy(csdev->buffer, page22, len);
err = scsi_execute_req_flags(sdev, cdb, DMA_TO_DEVICE, err = scsi_execute(sdev, cdb, DMA_TO_DEVICE, csdev->buffer, len, NULL,
csdev->buffer, len, &sshdr, &sshdr, CLARIION_TIMEOUT * HZ, CLARIION_RETRIES,
CLARIION_TIMEOUT * HZ, CLARIION_RETRIES, req_flags, 0, NULL);
NULL, req_flags, 0);
if (err) { if (err) {
if (scsi_sense_valid(&sshdr)) if (scsi_sense_valid(&sshdr))
res = trespass_endio(sdev, &sshdr); res = trespass_endio(sdev, &sshdr);
......
...@@ -100,9 +100,8 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h) ...@@ -100,9 +100,8 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h)
REQ_FAILFAST_DRIVER; REQ_FAILFAST_DRIVER;
retry: retry:
res = scsi_execute_req_flags(sdev, cmd, DMA_NONE, NULL, 0, &sshdr, res = scsi_execute(sdev, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
HP_SW_TIMEOUT, HP_SW_RETRIES, HP_SW_TIMEOUT, HP_SW_RETRIES, req_flags, 0, NULL);
NULL, req_flags, 0);
if (res) { if (res) {
if (scsi_sense_valid(&sshdr)) if (scsi_sense_valid(&sshdr))
ret = tur_done(sdev, h, &sshdr); ret = tur_done(sdev, h, &sshdr);
...@@ -139,9 +138,8 @@ static int hp_sw_start_stop(struct hp_sw_dh_data *h) ...@@ -139,9 +138,8 @@ static int hp_sw_start_stop(struct hp_sw_dh_data *h)
REQ_FAILFAST_DRIVER; REQ_FAILFAST_DRIVER;
retry: retry:
res = scsi_execute_req_flags(sdev, cmd, DMA_NONE, NULL, 0, &sshdr, res = scsi_execute(sdev, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
HP_SW_TIMEOUT, HP_SW_RETRIES, HP_SW_TIMEOUT, HP_SW_RETRIES, req_flags, 0, NULL);
NULL, req_flags, 0);
if (res) { if (res) {
if (!scsi_sense_valid(&sshdr)) { if (!scsi_sense_valid(&sshdr)) {
sdev_printk(KERN_WARNING, sdev, sdev_printk(KERN_WARNING, sdev,
......
...@@ -555,10 +555,9 @@ static void send_mode_select(struct work_struct *work) ...@@ -555,10 +555,9 @@ static void send_mode_select(struct work_struct *work)
(char *) h->ctlr->array_name, h->ctlr->index, (char *) h->ctlr->array_name, h->ctlr->index,
(retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying"); (retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying");
if (scsi_execute_req_flags(sdev, cdb, DMA_TO_DEVICE, if (scsi_execute(sdev, cdb, DMA_TO_DEVICE, &h->ctlr->mode_select,
&h->ctlr->mode_select, data_size, &sshdr, data_size, NULL, &sshdr, RDAC_TIMEOUT * HZ,
RDAC_TIMEOUT * HZ, RDAC_RETRIES, req_flags, 0, NULL)) {
RDAC_RETRIES, NULL, req_flags, 0)) {
err = mode_select_handle_sense(sdev, &sshdr); err = mode_select_handle_sense(sdev, &sshdr);
if (err == SCSI_DH_RETRY && retry_cnt--) if (err == SCSI_DH_RETRY && retry_cnt--)
goto retry; goto retry;
......
...@@ -289,17 +289,6 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, ...@@ -289,17 +289,6 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
} }
EXPORT_SYMBOL(scsi_execute); EXPORT_SYMBOL(scsi_execute);
int scsi_execute_req_flags(struct scsi_device *sdev, const unsigned char *cmd,
int data_direction, void *buffer, unsigned bufflen,
struct scsi_sense_hdr *sshdr, int timeout, int retries,
int *resid, u64 flags, req_flags_t rq_flags)
{
return scsi_execute(sdev, cmd, data_direction, buffer, bufflen,
NULL, sshdr, timeout, retries, flags, rq_flags,
resid);
}
EXPORT_SYMBOL(scsi_execute_req_flags);
/* /*
* Function: scsi_init_cmd_errh() * Function: scsi_init_cmd_errh()
* *
......
...@@ -1508,9 +1508,8 @@ static int sd_sync_cache(struct scsi_disk *sdkp) ...@@ -1508,9 +1508,8 @@ static int sd_sync_cache(struct scsi_disk *sdkp)
* Leave the rest of the command zero to indicate * Leave the rest of the command zero to indicate
* flush everything. * flush everything.
*/ */
res = scsi_execute_req_flags(sdp, cmd, DMA_NONE, NULL, 0, res = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
&sshdr, timeout, SD_MAX_RETRIES, timeout, SD_MAX_RETRIES, 0, RQF_PM, NULL);
NULL, 0, RQF_PM);
if (res == 0) if (res == 0)
break; break;
} }
...@@ -3296,8 +3295,8 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start) ...@@ -3296,8 +3295,8 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start)
if (!scsi_device_online(sdp)) if (!scsi_device_online(sdp))
return -ENODEV; return -ENODEV;
res = scsi_execute_req_flags(sdp, cmd, DMA_NONE, NULL, 0, &sshdr, res = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
SD_TIMEOUT, SD_MAX_RETRIES, NULL, 0, RQF_PM); SD_TIMEOUT, SD_MAX_RETRIES, 0, RQF_PM, NULL);
if (res) { if (res) {
sd_print_result(sdkp, "Start/Stop Unit failed", res); sd_print_result(sdkp, "Start/Stop Unit failed", res);
if (driver_byte(res) & DRIVER_SENSE) if (driver_byte(res) & DRIVER_SENSE)
......
...@@ -6915,9 +6915,9 @@ ufshcd_send_request_sense(struct ufs_hba *hba, struct scsi_device *sdp) ...@@ -6915,9 +6915,9 @@ ufshcd_send_request_sense(struct ufs_hba *hba, struct scsi_device *sdp)
goto out; goto out;
} }
ret = scsi_execute_req_flags(sdp, cmd, DMA_FROM_DEVICE, buffer, ret = scsi_execute(sdp, cmd, DMA_FROM_DEVICE, buffer,
UFSHCD_REQ_SENSE_SIZE, NULL, UFSHCD_REQ_SENSE_SIZE, NULL, NULL,
msecs_to_jiffies(1000), 3, NULL, 0, RQF_PM); msecs_to_jiffies(1000), 3, 0, RQF_PM, NULL);
if (ret) if (ret)
pr_err("%s: failed with err %d\n", __func__, ret); pr_err("%s: failed with err %d\n", __func__, ret);
...@@ -6982,8 +6982,8 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, ...@@ -6982,8 +6982,8 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
* callbacks hence set the RQF_PM flag so that it doesn't resume the * callbacks hence set the RQF_PM flag so that it doesn't resume the
* already suspended childs. * already suspended childs.
*/ */
ret = scsi_execute_req_flags(sdp, cmd, DMA_NONE, NULL, 0, &sshdr, ret = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
START_STOP_TIMEOUT, 0, NULL, 0, RQF_PM); START_STOP_TIMEOUT, 0, 0, RQF_PM, NULL);
if (ret) { if (ret) {
sdev_printk(KERN_WARNING, sdp, sdev_printk(KERN_WARNING, sdp,
"START_STOP failed for power mode: %d, result %x\n", "START_STOP failed for power mode: %d, result %x\n",
......
...@@ -413,17 +413,13 @@ extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, ...@@ -413,17 +413,13 @@ extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
unsigned char *sense, struct scsi_sense_hdr *sshdr, unsigned char *sense, struct scsi_sense_hdr *sshdr,
int timeout, int retries, u64 flags, int timeout, int retries, u64 flags,
req_flags_t rq_flags, int *resid); req_flags_t rq_flags, int *resid);
extern int scsi_execute_req_flags(struct scsi_device *sdev,
const unsigned char *cmd, int data_direction, void *buffer,
unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout,
int retries, int *resid, u64 flags, req_flags_t rq_flags);
static inline int scsi_execute_req(struct scsi_device *sdev, static inline int scsi_execute_req(struct scsi_device *sdev,
const unsigned char *cmd, int data_direction, void *buffer, const unsigned char *cmd, int data_direction, void *buffer,
unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout, unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout,
int retries, int *resid) int retries, int *resid)
{ {
return scsi_execute_req_flags(sdev, cmd, data_direction, buffer, return scsi_execute(sdev, cmd, data_direction, buffer,
bufflen, sshdr, timeout, retries, resid, 0, 0); bufflen, NULL, sshdr, timeout, retries, 0, 0, resid);
} }
extern void sdev_disable_disk_events(struct scsi_device *sdev); extern void sdev_disable_disk_events(struct scsi_device *sdev);
extern void sdev_enable_disk_events(struct scsi_device *sdev); extern void sdev_enable_disk_events(struct scsi_device *sdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment