Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
b2f42cfe
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看板
提交
b2f42cfe
编写于
2月 09, 2014
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lustre: don't open-code kernel_recvmsg()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
920220c1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
33 deletion
+9
-33
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
...ers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
+7
-23
drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
+2
-10
未找到文件。
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
浏览文件 @
b2f42cfe
...
...
@@ -215,15 +215,8 @@ ksocknal_lib_recv_iov (ksock_conn_t *conn)
#endif
struct
iovec
*
iov
=
conn
->
ksnc_rx_iov
;
struct
msghdr
msg
=
{
.
msg_name
=
NULL
,
.
msg_namelen
=
0
,
.
msg_iov
=
scratchiov
,
.
msg_iovlen
=
niov
,
.
msg_control
=
NULL
,
.
msg_controllen
=
0
,
.
msg_flags
=
0
};
mm_segment_t
oldmm
=
get_fs
();
int
nob
;
int
i
;
int
rc
;
...
...
@@ -241,10 +234,8 @@ ksocknal_lib_recv_iov (ksock_conn_t *conn)
}
LASSERT
(
nob
<=
conn
->
ksnc_rx_nob_wanted
);
set_fs
(
KERNEL_DS
);
rc
=
sock_recvmsg
(
conn
->
ksnc_sock
,
&
msg
,
nob
,
MSG_DONTWAIT
);
/* NB this is just a boolean..........................^ */
set_fs
(
oldmm
);
rc
=
kernel_recvmsg
(
conn
->
ksnc_sock
,
&
msg
,
(
struct
kvec
*
)
scratchiov
,
niov
,
nob
,
MSG_DONTWAIT
);
saved_csum
=
0
;
if
(
conn
->
ksnc_proto
==
&
ksocknal_protocol_v2x
)
{
...
...
@@ -333,14 +324,8 @@ ksocknal_lib_recv_kiov (ksock_conn_t *conn)
#endif
lnet_kiov_t
*
kiov
=
conn
->
ksnc_rx_kiov
;
struct
msghdr
msg
=
{
.
msg_name
=
NULL
,
.
msg_namelen
=
0
,
.
msg_iov
=
scratchiov
,
.
msg_control
=
NULL
,
.
msg_controllen
=
0
,
.
msg_flags
=
0
};
mm_segment_t
oldmm
=
get_fs
();
int
nob
;
int
i
;
int
rc
;
...
...
@@ -348,12 +333,13 @@ ksocknal_lib_recv_kiov (ksock_conn_t *conn)
void
*
addr
;
int
sum
;
int
fragnob
;
int
n
;
/* NB we can't trust socket ops to either consume our iovs
* or leave them alone. */
if
((
addr
=
ksocknal_lib_kiov_vmap
(
kiov
,
niov
,
scratchiov
,
pages
))
!=
NULL
)
{
nob
=
scratchiov
[
0
].
iov_len
;
msg
.
msg_iovle
n
=
1
;
n
=
1
;
}
else
{
for
(
nob
=
i
=
0
;
i
<
niov
;
i
++
)
{
...
...
@@ -361,15 +347,13 @@ ksocknal_lib_recv_kiov (ksock_conn_t *conn)
scratchiov
[
i
].
iov_base
=
kmap
(
kiov
[
i
].
kiov_page
)
+
kiov
[
i
].
kiov_offset
;
}
msg
.
msg_iovle
n
=
niov
;
n
=
niov
;
}
LASSERT
(
nob
<=
conn
->
ksnc_rx_nob_wanted
);
set_fs
(
KERNEL_DS
);
rc
=
sock_recvmsg
(
conn
->
ksnc_sock
,
&
msg
,
nob
,
MSG_DONTWAIT
);
/* NB this is just a boolean.......................^ */
set_fs
(
oldmm
);
rc
=
kernel_recvmsg
(
conn
->
ksnc_sock
,
&
msg
,
(
struct
kvec
*
)
scratchiov
,
n
,
nob
,
MSG_DONTWAIT
);
if
(
conn
->
ksnc_msg
.
ksm_csum
!=
0
)
{
for
(
i
=
0
,
sum
=
rc
;
sum
>
0
;
i
++
,
sum
-=
fragnob
)
{
...
...
drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
浏览文件 @
b2f42cfe
...
...
@@ -330,17 +330,11 @@ libcfs_sock_read (struct socket *sock, void *buffer, int nob, int timeout)
LASSERT
(
ticks
>
0
);
for
(;;)
{
struct
io
vec
iov
=
{
struct
k
vec
iov
=
{
.
iov_base
=
buffer
,
.
iov_len
=
nob
};
struct
msghdr
msg
=
{
.
msg_name
=
NULL
,
.
msg_namelen
=
0
,
.
msg_iov
=
&
iov
,
.
msg_iovlen
=
1
,
.
msg_control
=
NULL
,
.
msg_controllen
=
0
,
.
msg_flags
=
0
};
...
...
@@ -359,11 +353,9 @@ libcfs_sock_read (struct socket *sock, void *buffer, int nob, int timeout)
return
rc
;
}
set_fs
(
KERNEL_DS
);
then
=
jiffies
;
rc
=
sock_recvmsg
(
sock
,
&
msg
,
iov
.
iov_len
,
0
);
rc
=
kernel_recvmsg
(
sock
,
&
msg
,
&
iov
,
1
,
nob
,
0
);
ticks
-=
jiffies
-
then
;
set_fs
(
oldmm
);
if
(
rc
<
0
)
return
rc
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录