Commit 0739cd2
net: Introduce skb_send_sock() for sock_map
We only have skb_send_sock_locked() which requires callers
to use lock_sock(). Introduce a variant skb_send_sock()
which locks on its own, callers do not need to lock it
any more. This will save us from adding a ->sendmsg_locked
for each protocol.
To reuse the code, pass function pointers to __skb_send_sock()
and build skb_send_sock() and skb_send_sock_locked() on top.
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/20210331023237.41094-4-xiyou.wangcong@gmail.com1 parent b01fd6e commit 0739cd2
2 files changed
+49
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3626 | 3626 | | |
3627 | 3627 | | |
3628 | 3628 | | |
| 3629 | + | |
3629 | 3630 | | |
3630 | 3631 | | |
3631 | 3632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2500 | 2500 | | |
2501 | 2501 | | |
2502 | 2502 | | |
2503 | | - | |
2504 | | - | |
2505 | | - | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
2506 | 2529 | | |
2507 | 2530 | | |
2508 | 2531 | | |
| |||
2522 | 2545 | | |
2523 | 2546 | | |
2524 | 2547 | | |
2525 | | - | |
| 2548 | + | |
| 2549 | + | |
2526 | 2550 | | |
2527 | 2551 | | |
2528 | 2552 | | |
| |||
2553 | 2577 | | |
2554 | 2578 | | |
2555 | 2579 | | |
2556 | | - | |
2557 | | - | |
2558 | | - | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
2559 | 2585 | | |
2560 | 2586 | | |
2561 | 2587 | | |
| |||
2587 | 2613 | | |
2588 | 2614 | | |
2589 | 2615 | | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
2590 | 2624 | | |
2591 | 2625 | | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
2592 | 2633 | | |
2593 | 2634 | | |
2594 | 2635 | | |
| |||
0 commit comments