Skip to content

Commit fcbfffe

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
scsi: remove scsi_execute_req_flags
And switch all callers to use scsi_execute instead. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 76aaf87 commit fcbfffe

File tree

8 files changed

+27
-51
lines changed

8 files changed

+27
-51
lines changed

drivers/scsi/device_handler/scsi_dh_alua.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,9 @@ static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff,
151151
cdb[1] = MI_REPORT_TARGET_PGS;
152152
put_unaligned_be32(bufflen, &cdb[6]);
153153

154-
return scsi_execute_req_flags(sdev, cdb, DMA_FROM_DEVICE,
155-
buff, bufflen, sshdr,
156-
ALUA_FAILOVER_TIMEOUT * HZ,
157-
ALUA_FAILOVER_RETRIES, NULL,
158-
req_flags, 0);
154+
return scsi_execute(sdev, cdb, DMA_FROM_DEVICE, buff, bufflen, NULL,
155+
sshdr, ALUA_FAILOVER_TIMEOUT * HZ,
156+
ALUA_FAILOVER_RETRIES, req_flags, 0, NULL);
159157
}
160158

161159
/*
@@ -185,11 +183,9 @@ static int submit_stpg(struct scsi_device *sdev, int group_id,
185183
cdb[1] = MO_SET_TARGET_PGS;
186184
put_unaligned_be32(stpg_len, &cdb[6]);
187185

188-
return scsi_execute_req_flags(sdev, cdb, DMA_TO_DEVICE,
189-
stpg_data, stpg_len,
190-
sshdr, ALUA_FAILOVER_TIMEOUT * HZ,
191-
ALUA_FAILOVER_RETRIES, NULL,
192-
req_flags, 0);
186+
return scsi_execute(sdev, cdb, DMA_TO_DEVICE, stpg_data, stpg_len, NULL,
187+
sshdr, ALUA_FAILOVER_TIMEOUT * HZ,
188+
ALUA_FAILOVER_RETRIES, req_flags, 0, NULL);
193189
}
194190

195191
static struct alua_port_group *alua_find_get_pg(char *id_str, size_t id_size,

drivers/scsi/device_handler/scsi_dh_emc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,9 @@ static int send_trespass_cmd(struct scsi_device *sdev,
276276
BUG_ON((len > CLARIION_BUFFER_SIZE));
277277
memcpy(csdev->buffer, page22, len);
278278

279-
err = scsi_execute_req_flags(sdev, cdb, DMA_TO_DEVICE,
280-
csdev->buffer, len, &sshdr,
281-
CLARIION_TIMEOUT * HZ, CLARIION_RETRIES,
282-
NULL, req_flags, 0);
279+
err = scsi_execute(sdev, cdb, DMA_TO_DEVICE, csdev->buffer, len, NULL,
280+
&sshdr, CLARIION_TIMEOUT * HZ, CLARIION_RETRIES,
281+
req_flags, 0, NULL);
283282
if (err) {
284283
if (scsi_sense_valid(&sshdr))
285284
res = trespass_endio(sdev, &sshdr);

drivers/scsi/device_handler/scsi_dh_hp_sw.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,8 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h)
100100
REQ_FAILFAST_DRIVER;
101101

102102
retry:
103-
res = scsi_execute_req_flags(sdev, cmd, DMA_NONE, NULL, 0, &sshdr,
104-
HP_SW_TIMEOUT, HP_SW_RETRIES,
105-
NULL, req_flags, 0);
103+
res = scsi_execute(sdev, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
104+
HP_SW_TIMEOUT, HP_SW_RETRIES, req_flags, 0, NULL);
106105
if (res) {
107106
if (scsi_sense_valid(&sshdr))
108107
ret = tur_done(sdev, h, &sshdr);
@@ -139,9 +138,8 @@ static int hp_sw_start_stop(struct hp_sw_dh_data *h)
139138
REQ_FAILFAST_DRIVER;
140139

141140
retry:
142-
res = scsi_execute_req_flags(sdev, cmd, DMA_NONE, NULL, 0, &sshdr,
143-
HP_SW_TIMEOUT, HP_SW_RETRIES,
144-
NULL, req_flags, 0);
141+
res = scsi_execute(sdev, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
142+
HP_SW_TIMEOUT, HP_SW_RETRIES, req_flags, 0, NULL);
145143
if (res) {
146144
if (!scsi_sense_valid(&sshdr)) {
147145
sdev_printk(KERN_WARNING, sdev,

drivers/scsi/device_handler/scsi_dh_rdac.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,9 @@ static void send_mode_select(struct work_struct *work)
555555
(char *) h->ctlr->array_name, h->ctlr->index,
556556
(retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying");
557557

558-
if (scsi_execute_req_flags(sdev, cdb, DMA_TO_DEVICE,
559-
&h->ctlr->mode_select, data_size, &sshdr,
560-
RDAC_TIMEOUT * HZ,
561-
RDAC_RETRIES, NULL, req_flags, 0)) {
558+
if (scsi_execute(sdev, cdb, DMA_TO_DEVICE, &h->ctlr->mode_select,
559+
data_size, NULL, &sshdr, RDAC_TIMEOUT * HZ,
560+
RDAC_RETRIES, req_flags, 0, NULL)) {
562561
err = mode_select_handle_sense(sdev, &sshdr);
563562
if (err == SCSI_DH_RETRY && retry_cnt--)
564563
goto retry;

drivers/scsi/scsi_lib.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -289,17 +289,6 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
289289
}
290290
EXPORT_SYMBOL(scsi_execute);
291291

292-
int scsi_execute_req_flags(struct scsi_device *sdev, const unsigned char *cmd,
293-
int data_direction, void *buffer, unsigned bufflen,
294-
struct scsi_sense_hdr *sshdr, int timeout, int retries,
295-
int *resid, u64 flags, req_flags_t rq_flags)
296-
{
297-
return scsi_execute(sdev, cmd, data_direction, buffer, bufflen,
298-
NULL, sshdr, timeout, retries, flags, rq_flags,
299-
resid);
300-
}
301-
EXPORT_SYMBOL(scsi_execute_req_flags);
302-
303292
/*
304293
* Function: scsi_init_cmd_errh()
305294
*

drivers/scsi/sd.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,9 +1508,8 @@ static int sd_sync_cache(struct scsi_disk *sdkp)
15081508
* Leave the rest of the command zero to indicate
15091509
* flush everything.
15101510
*/
1511-
res = scsi_execute_req_flags(sdp, cmd, DMA_NONE, NULL, 0,
1512-
&sshdr, timeout, SD_MAX_RETRIES,
1513-
NULL, 0, RQF_PM);
1511+
res = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
1512+
timeout, SD_MAX_RETRIES, 0, RQF_PM, NULL);
15141513
if (res == 0)
15151514
break;
15161515
}
@@ -3296,8 +3295,8 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start)
32963295
if (!scsi_device_online(sdp))
32973296
return -ENODEV;
32983297

3299-
res = scsi_execute_req_flags(sdp, cmd, DMA_NONE, NULL, 0, &sshdr,
3300-
SD_TIMEOUT, SD_MAX_RETRIES, NULL, 0, RQF_PM);
3298+
res = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
3299+
SD_TIMEOUT, SD_MAX_RETRIES, 0, RQF_PM, NULL);
33013300
if (res) {
33023301
sd_print_result(sdkp, "Start/Stop Unit failed", res);
33033302
if (driver_byte(res) & DRIVER_SENSE)

drivers/scsi/ufs/ufshcd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6915,9 +6915,9 @@ ufshcd_send_request_sense(struct ufs_hba *hba, struct scsi_device *sdp)
69156915
goto out;
69166916
}
69176917

6918-
ret = scsi_execute_req_flags(sdp, cmd, DMA_FROM_DEVICE, buffer,
6919-
UFSHCD_REQ_SENSE_SIZE, NULL,
6920-
msecs_to_jiffies(1000), 3, NULL, 0, RQF_PM);
6918+
ret = scsi_execute(sdp, cmd, DMA_FROM_DEVICE, buffer,
6919+
UFSHCD_REQ_SENSE_SIZE, NULL, NULL,
6920+
msecs_to_jiffies(1000), 3, 0, RQF_PM, NULL);
69216921
if (ret)
69226922
pr_err("%s: failed with err %d\n", __func__, ret);
69236923

@@ -6982,8 +6982,8 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
69826982
* callbacks hence set the RQF_PM flag so that it doesn't resume the
69836983
* already suspended childs.
69846984
*/
6985-
ret = scsi_execute_req_flags(sdp, cmd, DMA_NONE, NULL, 0, &sshdr,
6986-
START_STOP_TIMEOUT, 0, NULL, 0, RQF_PM);
6985+
ret = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr,
6986+
START_STOP_TIMEOUT, 0, 0, RQF_PM, NULL);
69876987
if (ret) {
69886988
sdev_printk(KERN_WARNING, sdp,
69896989
"START_STOP failed for power mode: %d, result %x\n",

include/scsi/scsi_device.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,17 +413,13 @@ extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
413413
unsigned char *sense, struct scsi_sense_hdr *sshdr,
414414
int timeout, int retries, u64 flags,
415415
req_flags_t rq_flags, int *resid);
416-
extern int scsi_execute_req_flags(struct scsi_device *sdev,
417-
const unsigned char *cmd, int data_direction, void *buffer,
418-
unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout,
419-
int retries, int *resid, u64 flags, req_flags_t rq_flags);
420416
static inline int scsi_execute_req(struct scsi_device *sdev,
421417
const unsigned char *cmd, int data_direction, void *buffer,
422418
unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout,
423419
int retries, int *resid)
424420
{
425-
return scsi_execute_req_flags(sdev, cmd, data_direction, buffer,
426-
bufflen, sshdr, timeout, retries, resid, 0, 0);
421+
return scsi_execute(sdev, cmd, data_direction, buffer,
422+
bufflen, NULL, sshdr, timeout, retries, 0, 0, resid);
427423
}
428424
extern void sdev_disable_disk_events(struct scsi_device *sdev);
429425
extern void sdev_enable_disk_events(struct scsi_device *sdev);

0 commit comments

Comments
 (0)