Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78798
b: refs/heads/master
c: 72132c1
h: refs/heads/master
v: v3
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Jan 28, 2008
1 parent b00dca0 commit 39ce04e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2db82b534bd52b349f1b2ab3e63aa40ca0e466ab
refs/heads/master: 72132c1b6c7a7605cdfde86a9f58b6ca2b2195a6
2 changes: 1 addition & 1 deletion trunk/include/net/fib_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla)
}

extern int fib_rules_register(struct net *, struct fib_rules_ops *);
extern int fib_rules_unregister(struct net *, struct fib_rules_ops *);
extern void fib_rules_unregister(struct net *, struct fib_rules_ops *);
extern void fib_rules_cleanup_ops(struct fib_rules_ops *);

extern int fib_rules_lookup(struct fib_rules_ops *,
Expand Down
21 changes: 4 additions & 17 deletions trunk/net/core/fib_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,16 @@ void fib_rules_cleanup_ops(struct fib_rules_ops *ops)
}
EXPORT_SYMBOL_GPL(fib_rules_cleanup_ops);

int fib_rules_unregister(struct net *net, struct fib_rules_ops *ops)
void fib_rules_unregister(struct net *net, struct fib_rules_ops *ops)
{
int err = 0;
struct fib_rules_ops *o;

spin_lock(&net->rules_mod_lock);
list_for_each_entry(o, &net->rules_ops, list) {
if (o == ops) {
list_del_rcu(&o->list);
fib_rules_cleanup_ops(ops);
goto out;
}
}

err = -ENOENT;
out:
list_del_rcu(&ops->list);
fib_rules_cleanup_ops(ops);
spin_unlock(&net->rules_mod_lock);

synchronize_rcu();
if (!err)
release_net(net);

return err;
release_net(net);
}

EXPORT_SYMBOL_GPL(fib_rules_unregister);
Expand Down

0 comments on commit 39ce04e

Please sign in to comment.