Skip to content

Commit c25a18b

Browse files
Arnaldo Carvalho de Melodavem330
authored andcommitted
[DCCP]: Uninline some functions
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5e0817f commit c25a18b

5 files changed

Lines changed: 63 additions & 57 deletions

File tree

‎net/dccp/ccids/ccid3.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
* Reason for maths here is to avoid 32 bit overflow when a is big.
4747
* With this we get close to the limit.
4848
*/
49-
static inline u32 usecs_div(const u32 a, const u32 b)
49+
static u32 usecs_div(const u32 a, const u32 b)
5050
{
5151
const u32 div = a < (UINT_MAX / (USEC_PER_SEC / 10)) ? 10 :
5252
a < (UINT_MAX / (USEC_PER_SEC / 50)) ? 50 :
@@ -98,8 +98,8 @@ static const char *ccid3_tx_state_name(enum ccid3_hc_tx_states state)
9898
}
9999
#endif
100100

101-
static inline void ccid3_hc_tx_set_state(struct sock *sk,
102-
enum ccid3_hc_tx_states state)
101+
static void ccid3_hc_tx_set_state(struct sock *sk,
102+
enum ccid3_hc_tx_states state)
103103
{
104104
struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);
105105
enum ccid3_hc_tx_states oldstate = hctx->ccid3hctx_state;
@@ -708,8 +708,8 @@ static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state)
708708
}
709709
#endif
710710

711-
static inline void ccid3_hc_rx_set_state(struct sock *sk,
712-
enum ccid3_hc_rx_states state)
711+
static void ccid3_hc_rx_set_state(struct sock *sk,
712+
enum ccid3_hc_rx_states state)
713713
{
714714
struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk);
715715
enum ccid3_hc_rx_states oldstate = hcrx->ccid3hcrx_state;

‎net/dccp/dccp.h‎

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -138,53 +138,8 @@ extern unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu);
138138
extern const char *dccp_packet_name(const int type);
139139
extern const char *dccp_state_name(const int state);
140140

141-
static inline void dccp_set_state(struct sock *sk, const int state)
142-
{
143-
const int oldstate = sk->sk_state;
144-
145-
dccp_pr_debug("%s(%p) %-10.10s -> %s\n",
146-
dccp_role(sk), sk,
147-
dccp_state_name(oldstate), dccp_state_name(state));
148-
WARN_ON(state == oldstate);
149-
150-
switch (state) {
151-
case DCCP_OPEN:
152-
if (oldstate != DCCP_OPEN)
153-
DCCP_INC_STATS(DCCP_MIB_CURRESTAB);
154-
break;
155-
156-
case DCCP_CLOSED:
157-
if (oldstate == DCCP_CLOSING || oldstate == DCCP_OPEN)
158-
DCCP_INC_STATS(DCCP_MIB_ESTABRESETS);
159-
160-
sk->sk_prot->unhash(sk);
161-
if (inet_csk(sk)->icsk_bind_hash != NULL &&
162-
!(sk->sk_userlocks & SOCK_BINDPORT_LOCK))
163-
inet_put_port(&dccp_hashinfo, sk);
164-
/* fall through */
165-
default:
166-
if (oldstate == DCCP_OPEN)
167-
DCCP_DEC_STATS(DCCP_MIB_CURRESTAB);
168-
}
169-
170-
/* Change state AFTER socket is unhashed to avoid closed
171-
* socket sitting in hash tables.
172-
*/
173-
sk->sk_state = state;
174-
}
175-
176-
static inline void dccp_done(struct sock *sk)
177-
{
178-
dccp_set_state(sk, DCCP_CLOSED);
179-
dccp_clear_xmit_timers(sk);
180-
181-
sk->sk_shutdown = SHUTDOWN_MASK;
182-
183-
if (!sock_flag(sk, SOCK_DEAD))
184-
sk->sk_state_change(sk);
185-
else
186-
inet_csk_destroy_sock(sk);
187-
}
141+
extern void dccp_set_state(struct sock *sk, const int state);
142+
extern void dccp_done(struct sock *sk);
188143

189144
static inline void dccp_openreq_init(struct request_sock *req,
190145
struct dccp_sock *dp,

‎net/dccp/input.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static void dccp_rcv_closereq(struct sock *sk, struct sk_buff *skb)
5656
dccp_send_close(sk, 0);
5757
}
5858

59-
static inline void dccp_event_ack_recv(struct sock *sk, struct sk_buff *skb)
59+
static void dccp_event_ack_recv(struct sock *sk, struct sk_buff *skb)
6060
{
6161
struct dccp_sock *dp = dccp_sk(sk);
6262

@@ -151,9 +151,8 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb)
151151
return 0;
152152
}
153153

154-
static inline int __dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
155-
const struct dccp_hdr *dh,
156-
const unsigned len)
154+
static int __dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
155+
const struct dccp_hdr *dh, const unsigned len)
157156
{
158157
struct dccp_sock *dp = dccp_sk(sk);
159158

‎net/dccp/output.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static inline void dccp_event_ack_sent(struct sock *sk)
2727
inet_csk_clear_xmit_timer(sk, ICSK_TIME_DACK);
2828
}
2929

30-
static inline void dccp_skb_entail(struct sock *sk, struct sk_buff *skb)
30+
static void dccp_skb_entail(struct sock *sk, struct sk_buff *skb)
3131
{
3232
skb_set_owner_w(skb, sk);
3333
WARN_ON(sk->sk_send_head);

‎net/dccp/proto.c‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,58 @@ struct inet_hashinfo __cacheline_aligned dccp_hashinfo = {
5353

5454
EXPORT_SYMBOL_GPL(dccp_hashinfo);
5555

56+
void dccp_set_state(struct sock *sk, const int state)
57+
{
58+
const int oldstate = sk->sk_state;
59+
60+
dccp_pr_debug("%s(%p) %-10.10s -> %s\n",
61+
dccp_role(sk), sk,
62+
dccp_state_name(oldstate), dccp_state_name(state));
63+
WARN_ON(state == oldstate);
64+
65+
switch (state) {
66+
case DCCP_OPEN:
67+
if (oldstate != DCCP_OPEN)
68+
DCCP_INC_STATS(DCCP_MIB_CURRESTAB);
69+
break;
70+
71+
case DCCP_CLOSED:
72+
if (oldstate == DCCP_CLOSING || oldstate == DCCP_OPEN)
73+
DCCP_INC_STATS(DCCP_MIB_ESTABRESETS);
74+
75+
sk->sk_prot->unhash(sk);
76+
if (inet_csk(sk)->icsk_bind_hash != NULL &&
77+
!(sk->sk_userlocks & SOCK_BINDPORT_LOCK))
78+
inet_put_port(&dccp_hashinfo, sk);
79+
/* fall through */
80+
default:
81+
if (oldstate == DCCP_OPEN)
82+
DCCP_DEC_STATS(DCCP_MIB_CURRESTAB);
83+
}
84+
85+
/* Change state AFTER socket is unhashed to avoid closed
86+
* socket sitting in hash tables.
87+
*/
88+
sk->sk_state = state;
89+
}
90+
91+
EXPORT_SYMBOL_GPL(dccp_set_state);
92+
93+
void dccp_done(struct sock *sk)
94+
{
95+
dccp_set_state(sk, DCCP_CLOSED);
96+
dccp_clear_xmit_timers(sk);
97+
98+
sk->sk_shutdown = SHUTDOWN_MASK;
99+
100+
if (!sock_flag(sk, SOCK_DEAD))
101+
sk->sk_state_change(sk);
102+
else
103+
inet_csk_destroy_sock(sk);
104+
}
105+
106+
EXPORT_SYMBOL_GPL(dccp_done);
107+
56108
const char *dccp_packet_name(const int type)
57109
{
58110
static const char *dccp_packet_names[] = {

0 commit comments

Comments
 (0)