Change func bpf_iter_unreg_target() parameter from target name to target reg_info, similar to bpf_iter_reg_target().
Unified · Split
| @@ -1154,7 +1154,7 @@ struct bpf_iter_meta { · 1153 unmodified lines | |||
| 1154 | }; | 1154 | }; |
| 1155 | 1155 | ||
| 1156 | int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info); | 1156 | int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info); |
| 1157 | void bpf_iter_unreg_target(const char *target); | 1157 | void bpf_iter_unreg_target(const struct bpf_iter_reg *reg_info); |
| 1158 | bool bpf_iter_prog_supported(struct bpf_prog *prog); | 1158 | bool bpf_iter_prog_supported(struct bpf_prog *prog); |
| 1159 | int bpf_iter_link_attach(const union bpf_attr *attr, struct bpf_prog *prog); | 1159 | int bpf_iter_link_attach(const union bpf_attr *attr, struct bpf_prog *prog); |
| 1160 | int bpf_iter_new_fd(struct bpf_link *link); | 1160 | int bpf_iter_new_fd(struct bpf_link *link); |
| @@ -257,14 +257,14 @@ int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info) · 256 unmodified lines | |||
| 257 | return 0; | 257 | return 0; |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | void bpf_iter_unreg_target(const char *target) | 260 | void bpf_iter_unreg_target(const struct bpf_iter_reg *reg_info) |
| 261 | { | 261 | { |
| 262 | struct bpf_iter_target_info *tinfo; | 262 | struct bpf_iter_target_info *tinfo; |
| 263 | bool found = false; | 263 | bool found = false; |
| 264 | 264 | ||
| 265 | mutex_lock(&targets_mutex); | 265 | mutex_lock(&targets_mutex); |
| 266 | list_for_each_entry(tinfo, &targets, list) { | 266 | list_for_each_entry(tinfo, &targets, list) { |
| 267 | if (!strcmp(target, tinfo->reg_info->target)) { | 267 | if (reg_info == tinfo->reg_info) { |
| 268 | list_del(&tinfo->list); | 268 | list_del(&tinfo->list); |
| 269 | kfree(tinfo); | 269 | kfree(tinfo); |
| 270 | found = true; | 270 | found = true; |
| @@ -6412,7 +6412,7 @@ static int __init bpf_iter_register(void) · 6411 unmodified lines | |||
| 6412 | 6412 | ||
| 6413 | static void bpf_iter_unregister(void) | 6413 | static void bpf_iter_unregister(void) |
| 6414 | { | 6414 | { |
| 6415 | bpf_iter_unreg_target("ipv6_route"); | 6415 | bpf_iter_unreg_target(&ipv6_route_reg_info); |
| 6416 | } | 6416 | } |
| 6417 | #endif | 6417 | #endif |
| 6418 | #endif | 6418 | #endif |