Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
937abeaa
Commit
937abeaa
authored
Jun 19, 2005
by
Christoph Hellwig
Committed by
James Bottomley
Jun 26, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SCSI] use list_for_each_entry_safe in scsi_error.c
Signed-off-by:
James Bottomley
<
James.Bottomley@SteelEye.com
>
parent
3111b0d1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
38 deletions
+19
-38
drivers/scsi/scsi_error.c
drivers/scsi/scsi_error.c
+19
-38
No files found.
drivers/scsi/scsi_error.c
View file @
937abeaa
...
@@ -662,12 +662,10 @@ static void scsi_eh_finish_cmd(struct scsi_cmnd *scmd,
...
@@ -662,12 +662,10 @@ static void scsi_eh_finish_cmd(struct scsi_cmnd *scmd,
static
int
scsi_eh_get_sense
(
struct
list_head
*
work_q
,
static
int
scsi_eh_get_sense
(
struct
list_head
*
work_q
,
struct
list_head
*
done_q
)
struct
list_head
*
done_q
)
{
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
,
*
next
;
struct
scsi_cmnd
*
scmd
;
int
rtn
;
int
rtn
;
list_for_each_safe
(
lh
,
lh_sf
,
work_q
)
{
list_for_each_entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
if
((
scmd
->
eh_eflags
&
SCSI_EH_CANCEL_CMD
)
||
if
((
scmd
->
eh_eflags
&
SCSI_EH_CANCEL_CMD
)
||
SCSI_SENSE_VALID
(
scmd
))
SCSI_SENSE_VALID
(
scmd
))
continue
;
continue
;
...
@@ -798,12 +796,10 @@ static int scsi_eh_tur(struct scsi_cmnd *scmd)
...
@@ -798,12 +796,10 @@ static int scsi_eh_tur(struct scsi_cmnd *scmd)
static
int
scsi_eh_abort_cmds
(
struct
list_head
*
work_q
,
static
int
scsi_eh_abort_cmds
(
struct
list_head
*
work_q
,
struct
list_head
*
done_q
)
struct
list_head
*
done_q
)
{
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
,
*
next
;
struct
scsi_cmnd
*
scmd
;
int
rtn
;
int
rtn
;
list_for_each_safe
(
lh
,
lh_sf
,
work_q
)
{
list_for_each_entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
if
(
!
(
scmd
->
eh_eflags
&
SCSI_EH_CANCEL_CMD
))
if
(
!
(
scmd
->
eh_eflags
&
SCSI_EH_CANCEL_CMD
))
continue
;
continue
;
SCSI_LOG_ERROR_RECOVERY
(
3
,
printk
(
"%s: aborting cmd:"
SCSI_LOG_ERROR_RECOVERY
(
3
,
printk
(
"%s: aborting cmd:"
...
@@ -918,8 +914,7 @@ static int scsi_eh_stu(struct Scsi_Host *shost,
...
@@ -918,8 +914,7 @@ static int scsi_eh_stu(struct Scsi_Host *shost,
struct
list_head
*
work_q
,
struct
list_head
*
work_q
,
struct
list_head
*
done_q
)
struct
list_head
*
done_q
)
{
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
,
*
stu_scmd
,
*
next
;
struct
scsi_cmnd
*
scmd
,
*
stu_scmd
;
struct
scsi_device
*
sdev
;
struct
scsi_device
*
sdev
;
shost_for_each_device
(
sdev
,
shost
)
{
shost_for_each_device
(
sdev
,
shost
)
{
...
@@ -940,8 +935,8 @@ static int scsi_eh_stu(struct Scsi_Host *shost,
...
@@ -940,8 +935,8 @@ static int scsi_eh_stu(struct Scsi_Host *shost,
if
(
!
scsi_eh_try_stu
(
stu_scmd
))
{
if
(
!
scsi_eh_try_stu
(
stu_scmd
))
{
if
(
!
scsi_device_online
(
sdev
)
||
if
(
!
scsi_device_online
(
sdev
)
||
!
scsi_eh_tur
(
stu_scmd
))
{
!
scsi_eh_tur
(
stu_scmd
))
{
list_for_each_
safe
(
lh
,
lh_sf
,
work_q
)
{
list_for_each_
entry_safe
(
scmd
,
next
,
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
work_q
,
eh_entry
)
{
if
(
scmd
->
device
==
sdev
)
if
(
scmd
->
device
==
sdev
)
scsi_eh_finish_cmd
(
scmd
,
done_q
);
scsi_eh_finish_cmd
(
scmd
,
done_q
);
}
}
...
@@ -972,8 +967,7 @@ static int scsi_eh_bus_device_reset(struct Scsi_Host *shost,
...
@@ -972,8 +967,7 @@ static int scsi_eh_bus_device_reset(struct Scsi_Host *shost,
struct
list_head
*
work_q
,
struct
list_head
*
work_q
,
struct
list_head
*
done_q
)
struct
list_head
*
done_q
)
{
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
,
*
bdr_scmd
,
*
next
;
struct
scsi_cmnd
*
scmd
,
*
bdr_scmd
;
struct
scsi_device
*
sdev
;
struct
scsi_device
*
sdev
;
int
rtn
;
int
rtn
;
...
@@ -995,11 +989,8 @@ static int scsi_eh_bus_device_reset(struct Scsi_Host *shost,
...
@@ -995,11 +989,8 @@ static int scsi_eh_bus_device_reset(struct Scsi_Host *shost,
if
(
rtn
==
SUCCESS
)
{
if
(
rtn
==
SUCCESS
)
{
if
(
!
scsi_device_online
(
sdev
)
||
if
(
!
scsi_device_online
(
sdev
)
||
!
scsi_eh_tur
(
bdr_scmd
))
{
!
scsi_eh_tur
(
bdr_scmd
))
{
list_for_each_safe
(
lh
,
lh_sf
,
list_for_each_entry_safe
(
scmd
,
next
,
work_q
)
{
work_q
,
eh_entry
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
if
(
scmd
->
device
==
sdev
)
if
(
scmd
->
device
==
sdev
)
scsi_eh_finish_cmd
(
scmd
,
scsi_eh_finish_cmd
(
scmd
,
done_q
);
done_q
);
...
@@ -1082,9 +1073,7 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
...
@@ -1082,9 +1073,7 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
struct
list_head
*
work_q
,
struct
list_head
*
work_q
,
struct
list_head
*
done_q
)
struct
list_head
*
done_q
)
{
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
,
*
chan_scmd
,
*
next
;
struct
scsi_cmnd
*
scmd
;
struct
scsi_cmnd
*
chan_scmd
;
unsigned
int
channel
;
unsigned
int
channel
;
int
rtn
;
int
rtn
;
...
@@ -1115,9 +1104,7 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
...
@@ -1115,9 +1104,7 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
channel
));
channel
));
rtn
=
scsi_try_bus_reset
(
chan_scmd
);
rtn
=
scsi_try_bus_reset
(
chan_scmd
);
if
(
rtn
==
SUCCESS
)
{
if
(
rtn
==
SUCCESS
)
{
list_for_each_safe
(
lh
,
lh_sf
,
work_q
)
{
list_for_each_entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
if
(
channel
==
scmd
->
device
->
channel
)
if
(
channel
==
scmd
->
device
->
channel
)
if
(
!
scsi_device_online
(
scmd
->
device
)
||
if
(
!
scsi_device_online
(
scmd
->
device
)
||
!
scsi_eh_tur
(
scmd
))
!
scsi_eh_tur
(
scmd
))
...
@@ -1142,9 +1129,8 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
...
@@ -1142,9 +1129,8 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
static
int
scsi_eh_host_reset
(
struct
list_head
*
work_q
,
static
int
scsi_eh_host_reset
(
struct
list_head
*
work_q
,
struct
list_head
*
done_q
)
struct
list_head
*
done_q
)
{
{
struct
scsi_cmnd
*
scmd
,
*
next
;
int
rtn
;
int
rtn
;
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
;
if
(
!
list_empty
(
work_q
))
{
if
(
!
list_empty
(
work_q
))
{
scmd
=
list_entry
(
work_q
->
next
,
scmd
=
list_entry
(
work_q
->
next
,
...
@@ -1155,8 +1141,7 @@ static int scsi_eh_host_reset(struct list_head *work_q,
...
@@ -1155,8 +1141,7 @@ static int scsi_eh_host_reset(struct list_head *work_q,
rtn
=
scsi_try_host_reset
(
scmd
);
rtn
=
scsi_try_host_reset
(
scmd
);
if
(
rtn
==
SUCCESS
)
{
if
(
rtn
==
SUCCESS
)
{
list_for_each_safe
(
lh
,
lh_sf
,
work_q
)
{
list_for_each_entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
if
(
!
scsi_device_online
(
scmd
->
device
)
||
if
(
!
scsi_device_online
(
scmd
->
device
)
||
(
!
scsi_eh_try_stu
(
scmd
)
&&
!
scsi_eh_tur
(
scmd
))
||
(
!
scsi_eh_try_stu
(
scmd
)
&&
!
scsi_eh_tur
(
scmd
))
||
!
scsi_eh_tur
(
scmd
))
!
scsi_eh_tur
(
scmd
))
...
@@ -1180,11 +1165,9 @@ static int scsi_eh_host_reset(struct list_head *work_q,
...
@@ -1180,11 +1165,9 @@ static int scsi_eh_host_reset(struct list_head *work_q,
static
void
scsi_eh_offline_sdevs
(
struct
list_head
*
work_q
,
static
void
scsi_eh_offline_sdevs
(
struct
list_head
*
work_q
,
struct
list_head
*
done_q
)
struct
list_head
*
done_q
)
{
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
,
*
next
;
struct
scsi_cmnd
*
scmd
;
list_for_each_safe
(
lh
,
lh_sf
,
work_q
)
{
list_for_each_entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
printk
(
KERN_INFO
"scsi: Device offlined - not"
printk
(
KERN_INFO
"scsi: Device offlined - not"
" ready after error recovery: host"
" ready after error recovery: host"
" %d channel %d id %d lun %d
\n
"
,
" %d channel %d id %d lun %d
\n
"
,
...
@@ -1512,12 +1495,10 @@ static void scsi_eh_ready_devs(struct Scsi_Host *shost,
...
@@ -1512,12 +1495,10 @@ static void scsi_eh_ready_devs(struct Scsi_Host *shost,
**/
**/
static
void
scsi_eh_flush_done_q
(
struct
list_head
*
done_q
)
static
void
scsi_eh_flush_done_q
(
struct
list_head
*
done_q
)
{
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
,
*
next
;
struct
scsi_cmnd
*
scmd
;
list_for_each_safe
(
lh
,
lh_sf
,
done_q
)
{
list_for_each_entry_safe
(
scmd
,
next
,
done_q
,
eh_entry
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
list_del_init
(
&
scmd
->
eh_entry
);
list_del_init
(
lh
);
if
(
scsi_device_online
(
scmd
->
device
)
&&
if
(
scsi_device_online
(
scmd
->
device
)
&&
!
blk_noretry_request
(
scmd
->
request
)
&&
!
blk_noretry_request
(
scmd
->
request
)
&&
(
++
scmd
->
retries
<
scmd
->
allowed
))
{
(
++
scmd
->
retries
<
scmd
->
allowed
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment