Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Linaro
qcomlt
kernel
Commits
b2f42cfe
Commit
b2f42cfe
authored
11 years ago
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
lustre: don't open-code kernel_recvmsg()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
920220c1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
+7
-23
7 additions, 23 deletions
...ers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
+2
-10
2 additions, 10 deletions
drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
with
9 additions
and
33 deletions
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
+
7
−
23
View file @
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
)
{
...
...
This diff is collapsed.
Click to expand it.
drivers/staging/lustre/lustre/libcfs/linux/linux-tcpip.c
+
2
−
10
View file @
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment