Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
66f5dcef
Commit
66f5dcef
authored
Feb 08, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ocfs2: don't open-code kernel_sendmsg()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
4f18cd31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
20 deletions
+8
-20
fs/ocfs2/cluster/tcp.c
fs/ocfs2/cluster/tcp.c
+8
-20
No files found.
fs/ocfs2/cluster/tcp.c
View file @
66f5dcef
...
@@ -940,33 +940,21 @@ static int o2net_send_tcp_msg(struct socket *sock, struct kvec *vec,
...
@@ -940,33 +940,21 @@ static int o2net_send_tcp_msg(struct socket *sock, struct kvec *vec,
size_t
veclen
,
size_t
total
)
size_t
veclen
,
size_t
total
)
{
{
int
ret
;
int
ret
;
mm_segment_t
oldfs
;
struct
msghdr
msg
;
struct
msghdr
msg
=
{
.
msg_iov
=
(
struct
iovec
*
)
vec
,
.
msg_iovlen
=
veclen
,
};
if
(
sock
==
NULL
)
{
if
(
sock
==
NULL
)
{
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
goto
out
;
goto
out
;
}
}
oldfs
=
get_fs
();
ret
=
kernel_sendmsg
(
sock
,
&
msg
,
vec
,
veclen
,
total
);
set_fs
(
get_ds
());
if
(
likely
(
ret
==
total
))
ret
=
sock_sendmsg
(
sock
,
&
msg
,
total
);
return
0
;
set_fs
(
oldfs
);
mlog
(
ML_ERROR
,
"sendmsg returned %d instead of %zu
\n
"
,
ret
,
total
);
if
(
ret
!=
total
)
{
if
(
ret
>=
0
)
mlog
(
ML_ERROR
,
"sendmsg returned %d instead of %zu
\n
"
,
ret
,
ret
=
-
EPIPE
;
/* should be smarter, I bet */
total
);
if
(
ret
>=
0
)
ret
=
-
EPIPE
;
/* should be smarter, I bet */
goto
out
;
}
ret
=
0
;
out:
out:
if
(
ret
<
0
)
mlog
(
0
,
"returning error: %d
\n
"
,
ret
);
mlog
(
0
,
"returning error: %d
\n
"
,
ret
);
return
ret
;
return
ret
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment