Skip to content

Commit 03271f3

Browse files
Talal Ahmadkuba-moo
authored andcommitted
tcp: rename sk_wmem_free_skb
sk_wmem_free_skb() is only used by TCP. Rename it to make this clear, and move its declaration to include/net/tcp.h Signed-off-by: Talal Ahmad <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Acked-by: Arjun Roy <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 047304d commit 03271f3

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

include/net/sock.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,13 +1603,6 @@ static inline void sk_mem_uncharge(struct sock *sk, int size)
16031603
__sk_mem_reclaim(sk, SK_RECLAIM_CHUNK);
16041604
}
16051605

1606-
static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb)
1607-
{
1608-
sk_wmem_queued_add(sk, -skb->truesize);
1609-
sk_mem_uncharge(sk, skb->truesize);
1610-
__kfree_skb(skb);
1611-
}
1612-
16131606
static inline void sock_release_ownership(struct sock *sk)
16141607
{
16151608
if (sk->sk_lock.owned) {

include/net/tcp.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,13 @@ static inline bool tcp_out_of_memory(struct sock *sk)
290290
return false;
291291
}
292292

293+
static inline void tcp_wmem_free_skb(struct sock *sk, struct sk_buff *skb)
294+
{
295+
sk_wmem_queued_add(sk, -skb->truesize);
296+
sk_mem_uncharge(sk, skb->truesize);
297+
__kfree_skb(skb);
298+
}
299+
293300
void sk_forced_mem_schedule(struct sock *sk, int size);
294301

295302
bool tcp_check_oom(struct sock *sk, int shift);
@@ -1875,7 +1882,7 @@ static inline void tcp_rtx_queue_unlink_and_free(struct sk_buff *skb, struct soc
18751882
{
18761883
list_del(&skb->tcp_tsorted_anchor);
18771884
tcp_rtx_queue_unlink(skb, sk);
1878-
sk_wmem_free_skb(sk, skb);
1885+
tcp_wmem_free_skb(sk, skb);
18791886
}
18801887

18811888
static inline void tcp_push_pending_frames(struct sock *sk)

net/ipv4/tcp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ void tcp_remove_empty_skb(struct sock *sk)
932932
tcp_unlink_write_queue(skb, sk);
933933
if (tcp_write_queue_empty(sk))
934934
tcp_chrono_stop(sk, TCP_CHRONO_BUSY);
935-
sk_wmem_free_skb(sk, skb);
935+
tcp_wmem_free_skb(sk, skb);
936936
}
937937
}
938938

@@ -2893,7 +2893,7 @@ static void tcp_rtx_queue_purge(struct sock *sk)
28932893
* list_del(&skb->tcp_tsorted_anchor)
28942894
*/
28952895
tcp_rtx_queue_unlink(skb, sk);
2896-
sk_wmem_free_skb(sk, skb);
2896+
tcp_wmem_free_skb(sk, skb);
28972897
}
28982898
}
28992899

@@ -2904,7 +2904,7 @@ void tcp_write_queue_purge(struct sock *sk)
29042904
tcp_chrono_stop(sk, TCP_CHRONO_BUSY);
29052905
while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) {
29062906
tcp_skb_tsorted_anchor_cleanup(skb);
2907-
sk_wmem_free_skb(sk, skb);
2907+
tcp_wmem_free_skb(sk, skb);
29082908
}
29092909
tcp_rtx_queue_purge(sk);
29102910
INIT_LIST_HEAD(&tcp_sk(sk)->tsorted_sent_queue);

net/ipv4/tcp_output.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2412,7 +2412,7 @@ static int tcp_mtu_probe(struct sock *sk)
24122412
TCP_SKB_CB(nskb)->eor = TCP_SKB_CB(skb)->eor;
24132413
tcp_skb_collapse_tstamp(nskb, skb);
24142414
tcp_unlink_write_queue(skb, sk);
2415-
sk_wmem_free_skb(sk, skb);
2415+
tcp_wmem_free_skb(sk, skb);
24162416
} else {
24172417
TCP_SKB_CB(nskb)->tcp_flags |= TCP_SKB_CB(skb)->tcp_flags &
24182418
~(TCPHDR_FIN|TCPHDR_PSH);

0 commit comments

Comments
 (0)