History

bpf: Change func bpf_iter_unreg_target() signature

Change func bpf_iter_unreg_target() parameter from target name to target reg_info, similar to bpf_iter_reg_target().

Yonghong Song committed 6 years ago

Commit ab2ee4f1 parent 15172a43 files · +4 −4Browse files

Unified · Split

3 files
  1. include/linux/bpf.h +1 −1
  2. kernel/bpf/bpf_iter.c +2 −2
  3. net/ipv6/route.c +1 −1
include/linux/bpf.h+1−1
@@ -1154,7 +1154,7 @@ struct bpf_iter_meta { · 1153 unmodified lines
1154};1154};
1155 1155
1156int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info);1156int bpf_iter_reg_target(const struct bpf_iter_reg *reg_info);
1157void bpf_iter_unreg_target(const char *target);1157void bpf_iter_unreg_target(const struct bpf_iter_reg *reg_info);
1158bool bpf_iter_prog_supported(struct bpf_prog *prog);1158bool bpf_iter_prog_supported(struct bpf_prog *prog);
1159int bpf_iter_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);1159int bpf_iter_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
1160int bpf_iter_new_fd(struct bpf_link *link);1160int bpf_iter_new_fd(struct bpf_link *link);
kernel/bpf/bpf_iter.c+2−2
@@ -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
260void bpf_iter_unreg_target(const char *target)260void 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;
net/ipv6/route.c+1−1
@@ -6412,7 +6412,7 @@ static int __init bpf_iter_register(void) · 6411 unmodified lines
6412 6412
6413static void bpf_iter_unregister(void)6413static 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#endif6417#endif
6418#endif6418#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t