Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
f131883e
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f131883e
编写于
2月 20, 2006
作者:
J
Jeff Garzik
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'upstream-fixes'
上级
ccbe6d5e
2e242fa9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
9 deletion
+24
-9
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+9
-6
drivers/scsi/sata_qstor.c
drivers/scsi/sata_qstor.c
+1
-1
include/linux/libata.h
include/linux/libata.h
+14
-2
未找到文件。
drivers/scsi/libata-core.c
浏览文件 @
f131883e
...
...
@@ -2590,7 +2590,7 @@ static void ata_sg_clean(struct ata_queued_cmd *qc)
WARN_ON
(
sg
==
NULL
);
if
(
qc
->
flags
&
ATA_QCFLAG_SINGLE
)
WARN_ON
(
qc
->
n_elem
!=
1
);
WARN_ON
(
qc
->
n_elem
>
1
);
VPRINTK
(
"unmapping %u sg elements
\n
"
,
qc
->
n_elem
);
...
...
@@ -2613,7 +2613,7 @@ static void ata_sg_clean(struct ata_queued_cmd *qc)
kunmap_atomic
(
addr
,
KM_IRQ0
);
}
}
else
{
if
(
sg_dma_len
(
&
sg
[
0
])
>
0
)
if
(
qc
->
n_elem
)
dma_unmap_single
(
ap
->
host_set
->
dev
,
sg_dma_address
(
&
sg
[
0
]),
sg_dma_len
(
&
sg
[
0
]),
dir
);
...
...
@@ -2646,7 +2646,7 @@ static void ata_fill_sg(struct ata_queued_cmd *qc)
unsigned
int
idx
;
WARN_ON
(
qc
->
__sg
==
NULL
);
WARN_ON
(
qc
->
n_elem
==
0
);
WARN_ON
(
qc
->
n_elem
==
0
&&
qc
->
pad_len
==
0
);
idx
=
0
;
ata_for_each_sg
(
sg
,
qc
)
{
...
...
@@ -2791,6 +2791,7 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
int
dir
=
qc
->
dma_dir
;
struct
scatterlist
*
sg
=
qc
->
__sg
;
dma_addr_t
dma_address
;
int
trim_sg
=
0
;
/* we must lengthen transfers to end on a 32-bit boundary */
qc
->
pad_len
=
sg
->
length
&
3
;
...
...
@@ -2810,13 +2811,15 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
sg_dma_len
(
psg
)
=
ATA_DMA_PAD_SZ
;
/* trim sg */
sg
->
length
-=
qc
->
pad_len
;
if
(
sg
->
length
==
0
)
trim_sg
=
1
;
DPRINTK
(
"padding done, sg->length=%u pad_len=%u
\n
"
,
sg
->
length
,
qc
->
pad_len
);
}
if
(
!
sg
->
length
)
{
sg_dma_address
(
sg
)
=
0
;
if
(
trim_sg
)
{
qc
->
n_elem
--
;
goto
skip_map
;
}
...
...
@@ -2829,9 +2832,9 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
}
sg_dma_address
(
sg
)
=
dma_address
;
skip_map:
sg_dma_len
(
sg
)
=
sg
->
length
;
skip_map:
DPRINTK
(
"mapped buffer of %d bytes for %s
\n
"
,
sg_dma_len
(
sg
),
qc
->
tf
.
flags
&
ATA_TFLAG_WRITE
?
"write"
:
"read"
);
...
...
drivers/scsi/sata_qstor.c
浏览文件 @
f131883e
...
...
@@ -277,7 +277,7 @@ static unsigned int qs_fill_sg(struct ata_queued_cmd *qc)
u8
*
prd
=
pp
->
pkt
+
QS_CPB_BYTES
;
WARN_ON
(
qc
->
__sg
==
NULL
);
WARN_ON
(
qc
->
n_elem
==
0
);
WARN_ON
(
qc
->
n_elem
==
0
&&
qc
->
pad_len
==
0
);
nelem
=
0
;
ata_for_each_sg
(
sg
,
qc
)
{
...
...
include/linux/libata.h
浏览文件 @
f131883e
...
...
@@ -615,6 +615,16 @@ ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
return
0
;
}
static
inline
struct
scatterlist
*
ata_qc_first_sg
(
struct
ata_queued_cmd
*
qc
)
{
if
(
qc
->
n_elem
)
return
qc
->
__sg
;
if
(
qc
->
pad_len
)
return
&
qc
->
pad_sgent
;
return
NULL
;
}
static
inline
struct
scatterlist
*
ata_qc_next_sg
(
struct
scatterlist
*
sg
,
struct
ata_queued_cmd
*
qc
)
{
...
...
@@ -622,11 +632,13 @@ ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc)
return
NULL
;
if
(
++
sg
-
qc
->
__sg
<
qc
->
n_elem
)
return
sg
;
return
qc
->
pad_len
?
&
qc
->
pad_sgent
:
NULL
;
if
(
qc
->
pad_len
)
return
&
qc
->
pad_sgent
;
return
NULL
;
}
#define ata_for_each_sg(sg, qc) \
for (sg =
qc->__sg
; sg; sg = ata_qc_next_sg(sg, qc))
for (sg =
ata_qc_first_sg(qc)
; sg; sg = ata_qc_next_sg(sg, qc))
static
inline
unsigned
int
ata_tag_valid
(
unsigned
int
tag
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录