Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
357f435d
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看板
提交
357f435d
编写于
4月 08, 2016
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the copy vs. map logics in blk_rq_map_user_iov()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
03cc0789
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
39 deletion
+28
-39
block/blk-map.c
block/blk-map.c
+8
-39
include/linux/uio.h
include/linux/uio.h
+1
-0
lib/iov_iter.c
lib/iov_iter.c
+19
-0
未找到文件。
block/blk-map.c
浏览文件 @
357f435d
...
...
@@ -9,24 +9,6 @@
#include "blk.h"
static
bool
iovec_gap_to_prv
(
struct
request_queue
*
q
,
struct
iovec
*
prv
,
struct
iovec
*
cur
)
{
unsigned
long
prev_end
;
if
(
!
queue_virt_boundary
(
q
))
return
false
;
if
(
prv
->
iov_base
==
NULL
&&
prv
->
iov_len
==
0
)
/* prv is not set - don't check */
return
false
;
prev_end
=
(
unsigned
long
)(
prv
->
iov_base
+
prv
->
iov_len
);
return
(((
unsigned
long
)
cur
->
iov_base
&
queue_virt_boundary
(
q
))
||
prev_end
&
queue_virt_boundary
(
q
));
}
int
blk_rq_append_bio
(
struct
request_queue
*
q
,
struct
request
*
rq
,
struct
bio
*
bio
)
{
...
...
@@ -125,31 +107,18 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
struct
rq_map_data
*
map_data
,
const
struct
iov_iter
*
iter
,
gfp_t
gfp_mask
)
{
struct
iovec
iov
,
prv
=
{.
iov_base
=
NULL
,
.
iov_len
=
0
}
;
bool
copy
=
(
q
->
dma_pad_mask
&
iter
->
count
)
||
map_data
;
bool
copy
=
false
;
unsigned
long
align
=
q
->
dma_pad_mask
|
queue_dma_alignment
(
q
)
;
struct
bio
*
bio
=
NULL
;
struct
iov_iter
i
;
int
ret
;
if
(
!
iter
||
!
iter
->
count
)
return
-
EINVAL
;
iov_for_each
(
iov
,
i
,
*
iter
)
{
unsigned
long
uaddr
=
(
unsigned
long
)
iov
.
iov_base
;
if
(
!
iov
.
iov_len
)
return
-
EINVAL
;
/*
* Keep going so we check length of all segments
*/
if
((
uaddr
&
queue_dma_alignment
(
q
))
||
iovec_gap_to_prv
(
q
,
&
prv
,
&
iov
))
copy
=
true
;
prv
.
iov_base
=
iov
.
iov_base
;
prv
.
iov_len
=
iov
.
iov_len
;
}
if
(
map_data
)
copy
=
true
;
else
if
(
iov_iter_alignment
(
iter
)
&
align
)
copy
=
true
;
else
if
(
queue_virt_boundary
(
q
))
copy
=
queue_virt_boundary
(
q
)
&
iov_iter_gap_alignment
(
iter
);
i
=
*
iter
;
do
{
...
...
include/linux/uio.h
浏览文件 @
357f435d
...
...
@@ -87,6 +87,7 @@ size_t copy_from_iter(void *addr, size_t bytes, struct iov_iter *i);
size_t
copy_from_iter_nocache
(
void
*
addr
,
size_t
bytes
,
struct
iov_iter
*
i
);
size_t
iov_iter_zero
(
size_t
bytes
,
struct
iov_iter
*
);
unsigned
long
iov_iter_alignment
(
const
struct
iov_iter
*
i
);
unsigned
long
iov_iter_gap_alignment
(
const
struct
iov_iter
*
i
);
void
iov_iter_init
(
struct
iov_iter
*
i
,
int
direction
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
size_t
count
);
void
iov_iter_kvec
(
struct
iov_iter
*
i
,
int
direction
,
const
struct
kvec
*
kvec
,
...
...
lib/iov_iter.c
浏览文件 @
357f435d
...
...
@@ -569,6 +569,25 @@ unsigned long iov_iter_alignment(const struct iov_iter *i)
}
EXPORT_SYMBOL
(
iov_iter_alignment
);
unsigned
long
iov_iter_gap_alignment
(
const
struct
iov_iter
*
i
)
{
unsigned
long
res
=
0
;
size_t
size
=
i
->
count
;
if
(
!
size
)
return
0
;
iterate_all_kinds
(
i
,
size
,
v
,
(
res
|=
(
!
res
?
0
:
(
unsigned
long
)
v
.
iov_base
)
|
(
size
!=
v
.
iov_len
?
size
:
0
),
0
),
(
res
|=
(
!
res
?
0
:
(
unsigned
long
)
v
.
bv_offset
)
|
(
size
!=
v
.
bv_len
?
size
:
0
)),
(
res
|=
(
!
res
?
0
:
(
unsigned
long
)
v
.
iov_base
)
|
(
size
!=
v
.
iov_len
?
size
:
0
))
);
return
res
;
}
EXPORT_SYMBOL
(
iov_iter_gap_alignment
);
ssize_t
iov_iter_get_pages
(
struct
iov_iter
*
i
,
struct
page
**
pages
,
size_t
maxsize
,
unsigned
maxpages
,
size_t
*
start
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录