diff options
author | Eric Dumazet <edumazet@google.com> | 2015-03-17 00:06:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-17 15:17:59 -0400 |
commit | adc17d6a6ca08d11f70f6c49f3d40b87b68fe53f (patch) | |
tree | 6d0190d1a303106341be9109a4a2cbae9278ecb9 | |
parent | a9407000038805e5215a49c0a50c9e2b2ff38220 (diff) |
inet: move ir_mark to fill a hole
On 64bit arches, we can save 8 bytes in inet_request_sock
by moving ir_mark to fill a hole.
While we are at it, inet_request_mark() can get a const qualifier
for listener socket.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/inet_sock.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 3d8c09abb097..c9ed91891887 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -94,11 +94,11 @@ struct inet_request_sock { | |||
94 | acked : 1, | 94 | acked : 1, |
95 | no_srccheck: 1; | 95 | no_srccheck: 1; |
96 | kmemcheck_bitfield_end(flags); | 96 | kmemcheck_bitfield_end(flags); |
97 | u32 ir_mark; | ||
97 | union { | 98 | union { |
98 | struct ip_options_rcu *opt; | 99 | struct ip_options_rcu *opt; |
99 | struct sk_buff *pktopts; | 100 | struct sk_buff *pktopts; |
100 | }; | 101 | }; |
101 | u32 ir_mark; | ||
102 | }; | 102 | }; |
103 | 103 | ||
104 | static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) | 104 | static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) |
@@ -106,13 +106,12 @@ static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) | |||
106 | return (struct inet_request_sock *)sk; | 106 | return (struct inet_request_sock *)sk; |
107 | } | 107 | } |
108 | 108 | ||
109 | static inline u32 inet_request_mark(struct sock *sk, struct sk_buff *skb) | 109 | static inline u32 inet_request_mark(const struct sock *sk, struct sk_buff *skb) |
110 | { | 110 | { |
111 | if (!sk->sk_mark && sock_net(sk)->ipv4.sysctl_tcp_fwmark_accept) { | 111 | if (!sk->sk_mark && sock_net(sk)->ipv4.sysctl_tcp_fwmark_accept) |
112 | return skb->mark; | 112 | return skb->mark; |
113 | } else { | 113 | |
114 | return sk->sk_mark; | 114 | return sk->sk_mark; |
115 | } | ||
116 | } | 115 | } |
117 | 116 | ||
118 | struct inet_cork { | 117 | struct inet_cork { |