diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-15 02:30:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-18 21:52:53 -0400 |
commit | c720c7e8383aff1cb219bddf474ed89d850336e3 (patch) | |
tree | 4f12337e6690fccced376db9f501eaf98614a65e /net/ipv4/inet_connection_sock.c | |
parent | 988ade6b8e27e79311812f83a87b5cea11fabcd7 (diff) |
inet: rename some inet_sock fields
In order to have better cache layouts of struct sock (separate zones
for rx/tx paths), we need this preliminary patch.
Goal is to transfert fields used at lookup time in the first
read-mostly cache line (inside struct sock_common) and move sk_refcnt
to a separate cache line (only written by rx path)
This patch adds inet_ prefix to daddr, rcv_saddr, dport, num, saddr,
sport and id fields. This allows a future patch to define these
fields as macros, like sk_refcnt, without name clashes.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_connection_sock.c')
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 9139e8f6fdb1..f6a0af759932 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -368,7 +368,7 @@ struct dst_entry *inet_csk_route_req(struct sock *sk, | |||
368 | .proto = sk->sk_protocol, | 368 | .proto = sk->sk_protocol, |
369 | .flags = inet_sk_flowi_flags(sk), | 369 | .flags = inet_sk_flowi_flags(sk), |
370 | .uli_u = { .ports = | 370 | .uli_u = { .ports = |
371 | { .sport = inet_sk(sk)->sport, | 371 | { .sport = inet_sk(sk)->inet_sport, |
372 | .dport = ireq->rmt_port } } }; | 372 | .dport = ireq->rmt_port } } }; |
373 | struct net *net = sock_net(sk); | 373 | struct net *net = sock_net(sk); |
374 | 374 | ||
@@ -547,9 +547,9 @@ struct sock *inet_csk_clone(struct sock *sk, const struct request_sock *req, | |||
547 | newsk->sk_state = TCP_SYN_RECV; | 547 | newsk->sk_state = TCP_SYN_RECV; |
548 | newicsk->icsk_bind_hash = NULL; | 548 | newicsk->icsk_bind_hash = NULL; |
549 | 549 | ||
550 | inet_sk(newsk)->dport = inet_rsk(req)->rmt_port; | 550 | inet_sk(newsk)->inet_dport = inet_rsk(req)->rmt_port; |
551 | inet_sk(newsk)->num = ntohs(inet_rsk(req)->loc_port); | 551 | inet_sk(newsk)->inet_num = ntohs(inet_rsk(req)->loc_port); |
552 | inet_sk(newsk)->sport = inet_rsk(req)->loc_port; | 552 | inet_sk(newsk)->inet_sport = inet_rsk(req)->loc_port; |
553 | newsk->sk_write_space = sk_stream_write_space; | 553 | newsk->sk_write_space = sk_stream_write_space; |
554 | 554 | ||
555 | newicsk->icsk_retransmits = 0; | 555 | newicsk->icsk_retransmits = 0; |
@@ -580,8 +580,8 @@ void inet_csk_destroy_sock(struct sock *sk) | |||
580 | /* It cannot be in hash table! */ | 580 | /* It cannot be in hash table! */ |
581 | WARN_ON(!sk_unhashed(sk)); | 581 | WARN_ON(!sk_unhashed(sk)); |
582 | 582 | ||
583 | /* If it has not 0 inet_sk(sk)->num, it must be bound */ | 583 | /* If it has not 0 inet_sk(sk)->inet_num, it must be bound */ |
584 | WARN_ON(inet_sk(sk)->num && !inet_csk(sk)->icsk_bind_hash); | 584 | WARN_ON(inet_sk(sk)->inet_num && !inet_csk(sk)->icsk_bind_hash); |
585 | 585 | ||
586 | sk->sk_prot->destroy(sk); | 586 | sk->sk_prot->destroy(sk); |
587 | 587 | ||
@@ -616,8 +616,8 @@ int inet_csk_listen_start(struct sock *sk, const int nr_table_entries) | |||
616 | * after validation is complete. | 616 | * after validation is complete. |
617 | */ | 617 | */ |
618 | sk->sk_state = TCP_LISTEN; | 618 | sk->sk_state = TCP_LISTEN; |
619 | if (!sk->sk_prot->get_port(sk, inet->num)) { | 619 | if (!sk->sk_prot->get_port(sk, inet->inet_num)) { |
620 | inet->sport = htons(inet->num); | 620 | inet->inet_sport = htons(inet->inet_num); |
621 | 621 | ||
622 | sk_dst_reset(sk); | 622 | sk_dst_reset(sk); |
623 | sk->sk_prot->hash(sk); | 623 | sk->sk_prot->hash(sk); |
@@ -693,8 +693,8 @@ void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr) | |||
693 | const struct inet_sock *inet = inet_sk(sk); | 693 | const struct inet_sock *inet = inet_sk(sk); |
694 | 694 | ||
695 | sin->sin_family = AF_INET; | 695 | sin->sin_family = AF_INET; |
696 | sin->sin_addr.s_addr = inet->daddr; | 696 | sin->sin_addr.s_addr = inet->inet_daddr; |
697 | sin->sin_port = inet->dport; | 697 | sin->sin_port = inet->inet_dport; |
698 | } | 698 | } |
699 | 699 | ||
700 | EXPORT_SYMBOL_GPL(inet_csk_addr2sockaddr); | 700 | EXPORT_SYMBOL_GPL(inet_csk_addr2sockaddr); |