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
e73a67f7
Commit
e73a67f7
authored
Mar 18, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't open-code kernel_setsockopt()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
c1ae3cfa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
32 deletions
+6
-32
fs/ocfs2/cluster/tcp.c
fs/ocfs2/cluster/tcp.c
+4
-21
net/rds/tcp.c
net/rds/tcp.c
+1
-4
net/rds/tcp_send.c
net/rds/tcp_send.c
+1
-7
No files found.
fs/ocfs2/cluster/tcp.c
View file @
e73a67f7
...
@@ -1460,27 +1460,10 @@ static void o2net_rx_until_empty(struct work_struct *work)
...
@@ -1460,27 +1460,10 @@ static void o2net_rx_until_empty(struct work_struct *work)
static
int
o2net_set_nodelay
(
struct
socket
*
sock
)
static
int
o2net_set_nodelay
(
struct
socket
*
sock
)
{
{
int
ret
,
val
=
1
;
int
val
=
1
;
mm_segment_t
oldfs
;
oldfs
=
get_fs
();
return
kernel_setsockopt
(
sock
,
SOL_TCP
,
TCP_NODELAY
,
set_fs
(
KERNEL_DS
);
(
void
*
)
&
val
,
sizeof
(
val
));
/*
* Dear unsuspecting programmer,
*
* Don't use sock_setsockopt() for SOL_TCP. It doesn't check its level
* argument and assumes SOL_SOCKET so, say, your TCP_NODELAY will
* silently turn into SO_DEBUG.
*
* Yours,
* Keeper of hilariously fragile interfaces.
*/
ret
=
sock
->
ops
->
setsockopt
(
sock
,
SOL_TCP
,
TCP_NODELAY
,
(
char
__user
*
)
&
val
,
sizeof
(
val
));
set_fs
(
oldfs
);
return
ret
;
}
}
static
int
o2net_set_usertimeout
(
struct
socket
*
sock
)
static
int
o2net_set_usertimeout
(
struct
socket
*
sock
)
...
@@ -1488,7 +1471,7 @@ static int o2net_set_usertimeout(struct socket *sock)
...
@@ -1488,7 +1471,7 @@ static int o2net_set_usertimeout(struct socket *sock)
int
user_timeout
=
O2NET_TCP_USER_TIMEOUT
;
int
user_timeout
=
O2NET_TCP_USER_TIMEOUT
;
return
kernel_setsockopt
(
sock
,
SOL_TCP
,
TCP_USER_TIMEOUT
,
return
kernel_setsockopt
(
sock
,
SOL_TCP
,
TCP_USER_TIMEOUT
,
(
char
*
)
&
user_timeout
,
sizeof
(
user_timeout
));
(
void
*
)
&
user_timeout
,
sizeof
(
user_timeout
));
}
}
static
void
o2net_initialize_handshake
(
void
)
static
void
o2net_initialize_handshake
(
void
)
...
...
net/rds/tcp.c
View file @
e73a67f7
...
@@ -84,13 +84,10 @@ static struct ctl_table rds_tcp_sysctl_table[] = {
...
@@ -84,13 +84,10 @@ static struct ctl_table rds_tcp_sysctl_table[] = {
/* doing it this way avoids calling tcp_sk() */
/* doing it this way avoids calling tcp_sk() */
void
rds_tcp_nonagle
(
struct
socket
*
sock
)
void
rds_tcp_nonagle
(
struct
socket
*
sock
)
{
{
mm_segment_t
oldfs
=
get_fs
();
int
val
=
1
;
int
val
=
1
;
set_fs
(
KERNEL_DS
);
kernel_setsockopt
(
sock
,
SOL_TCP
,
TCP_NODELAY
,
(
void
*
)
&
val
,
sock
->
ops
->
setsockopt
(
sock
,
SOL_TCP
,
TCP_NODELAY
,
(
char
__user
*
)
&
val
,
sizeof
(
val
));
sizeof
(
val
));
set_fs
(
oldfs
);
}
}
u32
rds_tcp_snd_nxt
(
struct
rds_tcp_connection
*
tc
)
u32
rds_tcp_snd_nxt
(
struct
rds_tcp_connection
*
tc
)
...
...
net/rds/tcp_send.c
View file @
e73a67f7
...
@@ -40,13 +40,7 @@
...
@@ -40,13 +40,7 @@
static
void
rds_tcp_cork
(
struct
socket
*
sock
,
int
val
)
static
void
rds_tcp_cork
(
struct
socket
*
sock
,
int
val
)
{
{
mm_segment_t
oldfs
;
kernel_setsockopt
(
sock
,
SOL_TCP
,
TCP_CORK
,
(
void
*
)
&
val
,
sizeof
(
val
));
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
sock
->
ops
->
setsockopt
(
sock
,
SOL_TCP
,
TCP_CORK
,
(
char
__user
*
)
&
val
,
sizeof
(
val
));
set_fs
(
oldfs
);
}
}
void
rds_tcp_xmit_path_prepare
(
struct
rds_conn_path
*
cp
)
void
rds_tcp_xmit_path_prepare
(
struct
rds_conn_path
*
cp
)
...
...
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