Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
937abeaa
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
937abeaa
编写于
6月 19, 2005
作者:
C
Christoph Hellwig
提交者:
James Bottomley
6月 26, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SCSI] use list_for_each_entry_safe in scsi_error.c
Signed-off-by:
N
James Bottomley
<
James.Bottomley@SteelEye.com
>
上级
3111b0d1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
38 deletion
+19
-38
drivers/scsi/scsi_error.c
drivers/scsi/scsi_error.c
+19
-38
未找到文件。
drivers/scsi/scsi_error.c
浏览文件 @
937abeaa
...
...
@@ -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
,
struct
list_head
*
done_q
)
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
;
struct
scsi_cmnd
*
scmd
,
*
next
;
int
rtn
;
list_for_each_safe
(
lh
,
lh_sf
,
work_q
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
list_for_each_entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
if
((
scmd
->
eh_eflags
&
SCSI_EH_CANCEL_CMD
)
||
SCSI_SENSE_VALID
(
scmd
))
continue
;
...
...
@@ -798,12 +796,10 @@ static int scsi_eh_tur(struct scsi_cmnd *scmd)
static
int
scsi_eh_abort_cmds
(
struct
list_head
*
work_q
,
struct
list_head
*
done_q
)
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
;
struct
scsi_cmnd
*
scmd
,
*
next
;
int
rtn
;
list_for_each_safe
(
lh
,
lh_sf
,
work_q
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
list_for_each_entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
if
(
!
(
scmd
->
eh_eflags
&
SCSI_EH_CANCEL_CMD
))
continue
;
SCSI_LOG_ERROR_RECOVERY
(
3
,
printk
(
"%s: aborting cmd:"
...
...
@@ -918,8 +914,7 @@ static int scsi_eh_stu(struct Scsi_Host *shost,
struct
list_head
*
work_q
,
struct
list_head
*
done_q
)
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
,
*
stu_scmd
;
struct
scsi_cmnd
*
scmd
,
*
stu_scmd
,
*
next
;
struct
scsi_device
*
sdev
;
shost_for_each_device
(
sdev
,
shost
)
{
...
...
@@ -940,8 +935,8 @@ static int scsi_eh_stu(struct Scsi_Host *shost,
if
(
!
scsi_eh_try_stu
(
stu_scmd
))
{
if
(
!
scsi_device_online
(
sdev
)
||
!
scsi_eh_tur
(
stu_scmd
))
{
list_for_each_
safe
(
lh
,
lh_sf
,
work_q
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
list_for_each_
entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
if
(
scmd
->
device
==
sdev
)
scsi_eh_finish_cmd
(
scmd
,
done_q
);
}
...
...
@@ -972,8 +967,7 @@ static int scsi_eh_bus_device_reset(struct Scsi_Host *shost,
struct
list_head
*
work_q
,
struct
list_head
*
done_q
)
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
,
*
bdr_scmd
;
struct
scsi_cmnd
*
scmd
,
*
bdr_scmd
,
*
next
;
struct
scsi_device
*
sdev
;
int
rtn
;
...
...
@@ -995,11 +989,8 @@ static int scsi_eh_bus_device_reset(struct Scsi_Host *shost,
if
(
rtn
==
SUCCESS
)
{
if
(
!
scsi_device_online
(
sdev
)
||
!
scsi_eh_tur
(
bdr_scmd
))
{
list_for_each_safe
(
lh
,
lh_sf
,
work_q
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
list_for_each_entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
if
(
scmd
->
device
==
sdev
)
scsi_eh_finish_cmd
(
scmd
,
done_q
);
...
...
@@ -1082,9 +1073,7 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
struct
list_head
*
work_q
,
struct
list_head
*
done_q
)
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
;
struct
scsi_cmnd
*
chan_scmd
;
struct
scsi_cmnd
*
scmd
,
*
chan_scmd
,
*
next
;
unsigned
int
channel
;
int
rtn
;
...
...
@@ -1115,9 +1104,7 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
channel
));
rtn
=
scsi_try_bus_reset
(
chan_scmd
);
if
(
rtn
==
SUCCESS
)
{
list_for_each_safe
(
lh
,
lh_sf
,
work_q
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
list_for_each_entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
if
(
channel
==
scmd
->
device
->
channel
)
if
(
!
scsi_device_online
(
scmd
->
device
)
||
!
scsi_eh_tur
(
scmd
))
...
...
@@ -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
,
struct
list_head
*
done_q
)
{
struct
scsi_cmnd
*
scmd
,
*
next
;
int
rtn
;
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
;
if
(
!
list_empty
(
work_q
))
{
scmd
=
list_entry
(
work_q
->
next
,
...
...
@@ -1155,8 +1141,7 @@ static int scsi_eh_host_reset(struct list_head *work_q,
rtn
=
scsi_try_host_reset
(
scmd
);
if
(
rtn
==
SUCCESS
)
{
list_for_each_safe
(
lh
,
lh_sf
,
work_q
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
list_for_each_entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
if
(
!
scsi_device_online
(
scmd
->
device
)
||
(
!
scsi_eh_try_stu
(
scmd
)
&&
!
scsi_eh_tur
(
scmd
))
||
!
scsi_eh_tur
(
scmd
))
...
...
@@ -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
,
struct
list_head
*
done_q
)
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
;
struct
scsi_cmnd
*
scmd
,
*
next
;
list_for_each_safe
(
lh
,
lh_sf
,
work_q
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
list_for_each_entry_safe
(
scmd
,
next
,
work_q
,
eh_entry
)
{
printk
(
KERN_INFO
"scsi: Device offlined - not"
" ready after error recovery: host"
" %d channel %d id %d lun %d
\n
"
,
...
...
@@ -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
)
{
struct
list_head
*
lh
,
*
lh_sf
;
struct
scsi_cmnd
*
scmd
;
struct
scsi_cmnd
*
scmd
,
*
next
;
list_for_each_safe
(
lh
,
lh_sf
,
done_q
)
{
scmd
=
list_entry
(
lh
,
struct
scsi_cmnd
,
eh_entry
);
list_del_init
(
lh
);
list_for_each_entry_safe
(
scmd
,
next
,
done_q
,
eh_entry
)
{
list_del_init
(
&
scmd
->
eh_entry
);
if
(
scsi_device_online
(
scmd
->
device
)
&&
!
blk_noretry_request
(
scmd
->
request
)
&&
(
++
scmd
->
retries
<
scmd
->
allowed
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录