Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
98f0bc99
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看板
提交
98f0bc99
编写于
9月 23, 2017
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bio_map_user_iov(): move alignment check into the main loop
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
e2e115d1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
27 deletion
+27
-27
block/bio.c
block/bio.c
+27
-27
未找到文件。
block/bio.c
浏览文件 @
98f0bc99
...
...
@@ -1344,11 +1344,6 @@ struct bio *bio_map_user_iov(struct request_queue *q,
return
ERR_PTR
(
-
EINVAL
);
nr_pages
+=
end
-
start
;
/*
* buffer must be aligned to at least logical block size for now
*/
if
(
uaddr
&
queue_dma_alignment
(
q
))
return
ERR_PTR
(
-
EINVAL
);
}
if
(
!
nr_pages
)
...
...
@@ -1373,29 +1368,34 @@ struct bio *bio_map_user_iov(struct request_queue *q,
npages
=
DIV_ROUND_UP
(
offs
+
bytes
,
PAGE_SIZE
);
for
(
j
=
0
;
j
<
npages
;
j
++
)
{
unsigned
int
n
=
PAGE_SIZE
-
offs
;
unsigned
short
prev_bi_vcnt
=
bio
->
bi_vcnt
;
if
(
n
>
bytes
)
n
=
bytes
;
if
(
!
bio_add_pc_page
(
q
,
bio
,
pages
[
j
],
n
,
offs
))
break
;
/*
* check if vector was merged with previous
* drop page reference if needed
*/
if
(
bio
->
bi_vcnt
==
prev_bi_vcnt
)
put_page
(
pages
[
j
]);
added
+=
n
;
bytes
-=
n
;
offs
=
0
;
if
(
unlikely
(
offs
&
queue_dma_alignment
(
q
)))
{
ret
=
-
EINVAL
;
j
=
0
;
}
else
{
for
(
j
=
0
;
j
<
npages
;
j
++
)
{
struct
page
*
page
=
pages
[
j
];
unsigned
int
n
=
PAGE_SIZE
-
offs
;
unsigned
short
prev_bi_vcnt
=
bio
->
bi_vcnt
;
if
(
n
>
bytes
)
n
=
bytes
;
if
(
!
bio_add_pc_page
(
q
,
bio
,
page
,
n
,
offs
))
break
;
/*
* check if vector was merged with previous
* drop page reference if needed
*/
if
(
bio
->
bi_vcnt
==
prev_bi_vcnt
)
put_page
(
page
);
added
+=
n
;
bytes
-=
n
;
offs
=
0
;
}
iov_iter_advance
(
&
i
,
added
);
}
iov_iter_advance
(
&
i
,
added
);
/*
* release the pages we didn't map into the bio, if any
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录