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
11541154 };
11551155
11561156 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);
11581158 bool bpf_iter_prog_supported(struct bpf_prog *prog);
11591159 int bpf_iter_link_attach(const union bpf_attr *attr, struct bpf_prog *prog);
11601160 int 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
257257 return 0;
258258 }
259259
260−void bpf_iter_unreg_target(const char *target)
260+void bpf_iter_unreg_target(const struct bpf_iter_reg *reg_info)
261261 {
262262 struct bpf_iter_target_info *tinfo;
263263 bool found = false;
264264
265265 mutex_lock(&targets_mutex);
266266 list_for_each_entry(tinfo, &targets, list) {
267− if (!strcmp(target, tinfo->reg_info->target)) {
267+ if (reg_info == tinfo->reg_info) {
268268 list_del(&tinfo->list);
269269 kfree(tinfo);
270270 found = true;
net/ipv6/route.c+1−1
@@ -6412,7 +6412,7 @@ static int __init bpf_iter_register(void) · 6411 unmodified lines
64126412
64136413 static void bpf_iter_unregister(void)
64146414 {
6415− bpf_iter_unreg_target("ipv6_route");
6415+ bpf_iter_unreg_target(&ipv6_route_reg_info);
64166416 }
64176417 #endif
64186418 #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