Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
e0eb093e
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e0eb093e
编写于
11月 15, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch sctp_user_addto_chunk() and sctp_datamsg_from_user() to passing iov_iter
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
8feb2fb2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
17 deletion
+19
-17
include/net/sctp/structs.h
include/net/sctp/structs.h
+3
-3
net/sctp/chunk.c
net/sctp/chunk.c
+4
-5
net/sctp/sm_make_chunk.c
net/sctp/sm_make_chunk.c
+8
-8
net/sctp/socket.c
net/sctp/socket.c
+4
-1
未找到文件。
include/net/sctp/structs.h
浏览文件 @
e0eb093e
...
...
@@ -531,7 +531,7 @@ struct sctp_datamsg {
struct
sctp_datamsg
*
sctp_datamsg_from_user
(
struct
sctp_association
*
,
struct
sctp_sndrcvinfo
*
,
struct
msghdr
*
,
int
len
);
struct
iov_iter
*
);
void
sctp_datamsg_free
(
struct
sctp_datamsg
*
);
void
sctp_datamsg_put
(
struct
sctp_datamsg
*
);
void
sctp_chunk_fail
(
struct
sctp_chunk
*
,
int
error
);
...
...
@@ -647,8 +647,8 @@ struct sctp_chunk {
void
sctp_chunk_hold
(
struct
sctp_chunk
*
);
void
sctp_chunk_put
(
struct
sctp_chunk
*
);
int
sctp_user_addto_chunk
(
struct
sctp_chunk
*
chunk
,
int
off
,
int
len
,
struct
iov
ec
*
data
);
int
sctp_user_addto_chunk
(
struct
sctp_chunk
*
chunk
,
int
len
,
struct
iov
_iter
*
from
);
void
sctp_chunk_free
(
struct
sctp_chunk
*
);
void
*
sctp_addto_chunk
(
struct
sctp_chunk
*
,
int
len
,
const
void
*
data
);
struct
sctp_chunk
*
sctp_chunkify
(
struct
sk_buff
*
,
...
...
net/sctp/chunk.c
浏览文件 @
e0eb093e
...
...
@@ -164,7 +164,7 @@ static void sctp_datamsg_assign(struct sctp_datamsg *msg, struct sctp_chunk *chu
*/
struct
sctp_datamsg
*
sctp_datamsg_from_user
(
struct
sctp_association
*
asoc
,
struct
sctp_sndrcvinfo
*
sinfo
,
struct
msghdr
*
msgh
,
int
msg_len
)
struct
iov_iter
*
from
)
{
int
max
,
whole
,
i
,
offset
,
over
,
err
;
int
len
,
first_len
;
...
...
@@ -172,6 +172,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
struct
sctp_chunk
*
chunk
;
struct
sctp_datamsg
*
msg
;
struct
list_head
*
pos
,
*
temp
;
size_t
msg_len
=
iov_iter_count
(
from
);
__u8
frag
;
msg
=
sctp_datamsg_new
(
GFP_KERNEL
);
...
...
@@ -279,12 +280,10 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
goto
errout
;
}
err
=
sctp_user_addto_chunk
(
chunk
,
offset
,
len
,
msgh
->
msg_iov
);
err
=
sctp_user_addto_chunk
(
chunk
,
len
,
from
);
if
(
err
<
0
)
goto
errout_chunk_free
;
offset
+=
len
;
/* Put the chunk->skb back into the form expected by send. */
__skb_pull
(
chunk
->
skb
,
(
__u8
*
)
chunk
->
chunk_hdr
-
(
__u8
*
)
chunk
->
skb
->
data
);
...
...
@@ -317,7 +316,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
goto
errout
;
}
err
=
sctp_user_addto_chunk
(
chunk
,
o
ffset
,
over
,
msgh
->
msg_iov
);
err
=
sctp_user_addto_chunk
(
chunk
,
o
ver
,
from
);
/* Put the chunk->skb back into the form expected by send. */
__skb_pull
(
chunk
->
skb
,
(
__u8
*
)
chunk
->
chunk_hdr
...
...
net/sctp/sm_make_chunk.c
浏览文件 @
e0eb093e
...
...
@@ -1491,26 +1491,26 @@ static void *sctp_addto_chunk_fixed(struct sctp_chunk *chunk,
* chunk is not big enough.
* Returns a kernel err value.
*/
int
sctp_user_addto_chunk
(
struct
sctp_chunk
*
chunk
,
int
off
,
int
len
,
struct
iov
ec
*
data
)
int
sctp_user_addto_chunk
(
struct
sctp_chunk
*
chunk
,
int
len
,
struct
iov
_iter
*
from
)
{
__u8
*
target
;
int
err
=
0
;
void
*
target
;
ssize_t
copied
;
/* Make room in chunk for data. */
target
=
skb_put
(
chunk
->
skb
,
len
);
/* Copy data (whole iovec) into chunk */
if
((
err
=
memcpy_fromiovecend
(
target
,
data
,
off
,
len
)))
goto
out
;
copied
=
copy_from_iter
(
target
,
len
,
from
);
if
(
copied
!=
len
)
return
-
EFAULT
;
/* Adjust the chunk length field. */
chunk
->
chunk_hdr
->
length
=
htons
(
ntohs
(
chunk
->
chunk_hdr
->
length
)
+
len
);
chunk
->
chunk_end
=
skb_tail_pointer
(
chunk
->
skb
);
out:
return
err
;
return
0
;
}
/* Helper function to assign a TSN if needed. This assumes that both
...
...
net/sctp/socket.c
浏览文件 @
e0eb093e
...
...
@@ -1609,6 +1609,9 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
__u16
sinfo_flags
=
0
;
long
timeo
;
int
err
;
struct
iov_iter
from
;
iov_iter_init
(
&
from
,
WRITE
,
msg
->
msg_iov
,
msg
->
msg_iovlen
,
msg_len
);
err
=
0
;
sp
=
sctp_sk
(
sk
);
...
...
@@ -1947,7 +1950,7 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
}
/* Break the message into multiple chunks of maximum size. */
datamsg
=
sctp_datamsg_from_user
(
asoc
,
sinfo
,
msg
,
msg_len
);
datamsg
=
sctp_datamsg_from_user
(
asoc
,
sinfo
,
&
from
);
if
(
IS_ERR
(
datamsg
))
{
err
=
PTR_ERR
(
datamsg
);
goto
out_free
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录