Commit b34b4482 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

o net: reduce the data dependency of struct sock/struct tcp_tw_bucket

With this the area that is shared among struct sock and struct tcp_tw_bucket
is exact, i.e. there is no fields that are in struct sock and only reused
for other reasons in tcp_tw_bucket, while keeping both struct free of holes.
parent 71290d21
......@@ -157,18 +157,18 @@ do { spin_lock_init(&((__sk)->lock.slock)); \
*/
struct sock {
/* Begin of struct sock/struct tcp_tw_bucket shared layout */
volatile unsigned char state,
zapped;
unsigned short family;
volatile unsigned char state;
unsigned char reuse;
unsigned char shutdown;
int bound_dev_if;
struct sock *next;
struct sock **pprev;
struct sock *bind_next;
struct sock **bind_pprev;
atomic_t refcnt;
unsigned short family;
/* End of struct sock/struct tcp_tw_bucket shared layout */
volatile unsigned char zapped;
unsigned char shutdown;
unsigned char use_write_queue;
unsigned char userlocks;
socket_lock_t lock;
......
......@@ -169,10 +169,9 @@ struct tcp_tw_bucket {
* XXX Yes I know this is gross, but I'd have to edit every single
* XXX networking file if I created a "struct sock_header". -DaveM
*/
volatile unsigned char state, /* Connection state */
substate; /* "zapped" -> "substate" */
unsigned short family;
volatile unsigned char state; /* Connection state */
unsigned char reuse; /* SO_REUSEADDR setting */
unsigned char rcv_wscale; /* also TW bucket specific */
int bound_dev_if;
/* Main hash linkage for various protocol lookup tables. */
struct sock *next;
......@@ -180,8 +179,9 @@ struct tcp_tw_bucket {
struct sock *bind_next;
struct sock **bind_pprev;
atomic_t refcnt;
unsigned short family;
/* End of struct sock/struct tcp_tw_bucket shared layout */
volatile unsigned char substate;
unsigned char rcv_wscale;
__u16 sport;
/* Socket demultiplex comparisons on incoming packets. */
/* these five are in inet_opt */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment