Commit ea5b229
bpf: Remove migrate_{disable|enable} in ->map_for_each_callback
BPF program may call bpf_for_each_map_elem(), and it will call
the ->map_for_each_callback callback of related bpf map. Considering the
running context of bpf program has already disabled migration, remove
the unnecessary migrate_{disable|enable} pair in the implementations of
->map_for_each_callback. To ensure the guarantee will not be voilated
later, also add cant_migrate() check in the implementations.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20250108010728.207536-3-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent 1b1a01d commit ea5b229
2 files changed
Lines changed: 7 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
| 738 | + | |
| 739 | + | |
738 | 740 | | |
739 | 741 | | |
740 | 742 | | |
741 | 743 | | |
742 | 744 | | |
743 | | - | |
744 | | - | |
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
| |||
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
759 | | - | |
760 | | - | |
761 | 759 | | |
762 | 760 | | |
763 | 761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2208 | 2208 | | |
2209 | 2209 | | |
2210 | 2210 | | |
| 2211 | + | |
| 2212 | + | |
2211 | 2213 | | |
2212 | 2214 | | |
2213 | 2215 | | |
2214 | 2216 | | |
2215 | 2217 | | |
2216 | 2218 | | |
2217 | | - | |
2218 | | - | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
2219 | 2222 | | |
2220 | | - | |
2221 | | - | |
2222 | 2223 | | |
2223 | 2224 | | |
2224 | 2225 | | |
| |||
2244 | 2245 | | |
2245 | 2246 | | |
2246 | 2247 | | |
2247 | | - | |
2248 | | - | |
2249 | 2248 | | |
2250 | 2249 | | |
2251 | 2250 | | |
| |||
0 commit comments