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
nexedi
linux
Commits
2c7d3dac
Commit
2c7d3dac
authored
Apr 09, 2018
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net/tcp: convert to ->poll_mask
Signed-off-by:
Christoph Hellwig
<
hch@lst.de
>
parent
984652dd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
21 deletions
+9
-21
include/net/tcp.h
include/net/tcp.h
+1
-2
net/ipv4/af_inet.c
net/ipv4/af_inet.c
+1
-1
net/ipv4/tcp.c
net/ipv4/tcp.c
+6
-17
net/ipv6/af_inet6.c
net/ipv6/af_inet6.c
+1
-1
No files found.
include/net/tcp.h
View file @
2c7d3dac
...
@@ -388,8 +388,7 @@ bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst);
...
@@ -388,8 +388,7 @@ bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst);
void
tcp_close
(
struct
sock
*
sk
,
long
timeout
);
void
tcp_close
(
struct
sock
*
sk
,
long
timeout
);
void
tcp_init_sock
(
struct
sock
*
sk
);
void
tcp_init_sock
(
struct
sock
*
sk
);
void
tcp_init_transfer
(
struct
sock
*
sk
,
int
bpf_op
);
void
tcp_init_transfer
(
struct
sock
*
sk
,
int
bpf_op
);
__poll_t
tcp_poll
(
struct
file
*
file
,
struct
socket
*
sock
,
__poll_t
tcp_poll_mask
(
struct
socket
*
sock
,
__poll_t
events
);
struct
poll_table_struct
*
wait
);
int
tcp_getsockopt
(
struct
sock
*
sk
,
int
level
,
int
optname
,
int
tcp_getsockopt
(
struct
sock
*
sk
,
int
level
,
int
optname
,
char
__user
*
optval
,
int
__user
*
optlen
);
char
__user
*
optval
,
int
__user
*
optlen
);
int
tcp_setsockopt
(
struct
sock
*
sk
,
int
level
,
int
optname
,
int
tcp_setsockopt
(
struct
sock
*
sk
,
int
level
,
int
optname
,
...
...
net/ipv4/af_inet.c
View file @
2c7d3dac
...
@@ -986,7 +986,7 @@ const struct proto_ops inet_stream_ops = {
...
@@ -986,7 +986,7 @@ const struct proto_ops inet_stream_ops = {
.
socketpair
=
sock_no_socketpair
,
.
socketpair
=
sock_no_socketpair
,
.
accept
=
inet_accept
,
.
accept
=
inet_accept
,
.
getname
=
inet_getname
,
.
getname
=
inet_getname
,
.
poll
=
tcp_poll
,
.
poll
_mask
=
tcp_poll_mask
,
.
ioctl
=
inet_ioctl
,
.
ioctl
=
inet_ioctl
,
.
listen
=
inet_listen
,
.
listen
=
inet_listen
,
.
shutdown
=
inet_shutdown
,
.
shutdown
=
inet_shutdown
,
...
...
net/ipv4/tcp.c
View file @
2c7d3dac
...
@@ -494,32 +494,21 @@ static inline bool tcp_stream_is_readable(const struct tcp_sock *tp,
...
@@ -494,32 +494,21 @@ static inline bool tcp_stream_is_readable(const struct tcp_sock *tp,
}
}
/*
/*
* Wait for a TCP event.
* Socket is not locked. We are protected from async events by poll logic and
*
* correct handling of state changes made by other threads is impossible in
* Note that we don't need to lock the socket, as the upper poll layers
* any case.
* take care of normal races (between the test and the event) and we don't
* go look at any of the socket buffers directly.
*/
*/
__poll_t
tcp_poll
(
struct
file
*
file
,
struct
socket
*
sock
,
poll_table
*
wait
)
__poll_t
tcp_poll
_mask
(
struct
socket
*
sock
,
__poll_t
events
)
{
{
__poll_t
mask
;
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
const
struct
tcp_sock
*
tp
=
tcp_sk
(
sk
);
const
struct
tcp_sock
*
tp
=
tcp_sk
(
sk
);
__poll_t
mask
=
0
;
int
state
;
int
state
;
sock_poll_wait
(
file
,
sk_sleep
(
sk
),
wait
);
state
=
inet_sk_state_load
(
sk
);
state
=
inet_sk_state_load
(
sk
);
if
(
state
==
TCP_LISTEN
)
if
(
state
==
TCP_LISTEN
)
return
inet_csk_listen_poll
(
sk
);
return
inet_csk_listen_poll
(
sk
);
/* Socket is not locked. We are protected from async events
* by poll logic and correct handling of state changes
* made by other threads is impossible in any case.
*/
mask
=
0
;
/*
/*
* EPOLLHUP is certainly not done right. But poll() doesn't
* EPOLLHUP is certainly not done right. But poll() doesn't
* have a notion of HUP in just one direction, and for a
* have a notion of HUP in just one direction, and for a
...
@@ -600,7 +589,7 @@ __poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
...
@@ -600,7 +589,7 @@ __poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
return
mask
;
return
mask
;
}
}
EXPORT_SYMBOL
(
tcp_poll
);
EXPORT_SYMBOL
(
tcp_poll
_mask
);
int
tcp_ioctl
(
struct
sock
*
sk
,
int
cmd
,
unsigned
long
arg
)
int
tcp_ioctl
(
struct
sock
*
sk
,
int
cmd
,
unsigned
long
arg
)
{
{
...
...
net/ipv6/af_inet6.c
View file @
2c7d3dac
...
@@ -571,7 +571,7 @@ const struct proto_ops inet6_stream_ops = {
...
@@ -571,7 +571,7 @@ const struct proto_ops inet6_stream_ops = {
.
socketpair
=
sock_no_socketpair
,
/* a do nothing */
.
socketpair
=
sock_no_socketpair
,
/* a do nothing */
.
accept
=
inet_accept
,
/* ok */
.
accept
=
inet_accept
,
/* ok */
.
getname
=
inet6_getname
,
.
getname
=
inet6_getname
,
.
poll
=
tcp_poll
,
/* ok */
.
poll
_mask
=
tcp_poll_mask
,
/* ok */
.
ioctl
=
inet6_ioctl
,
/* must change */
.
ioctl
=
inet6_ioctl
,
/* must change */
.
listen
=
inet_listen
,
/* ok */
.
listen
=
inet_listen
,
/* ok */
.
shutdown
=
inet_shutdown
,
/* ok */
.
shutdown
=
inet_shutdown
,
/* ok */
...
...
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