Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6418
b: refs/heads/master
c: e5b4376
h: refs/heads/master
v: v3
  • Loading branch information
Robert Olsson authored and David S. Miller committed Aug 29, 2005
1 parent 107eff4 commit 9f41f41
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 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: 3625796806419d97641d90e0f197eab9b952212e
refs/heads/master: e5b4376074e02b783e56a8f7c42d544e18112c4e
21 changes: 21 additions & 0 deletions trunk/include/linux/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,27 @@ static inline void hlist_add_after(struct hlist_node *n,
next->next->pprev = &next->next;
}

static inline void hlist_add_before_rcu(struct hlist_node *n,
struct hlist_node *next)
{
n->pprev = next->pprev;
n->next = next;
smp_wmb();
next->pprev = &n->next;
*(n->pprev) = n;
}

static inline void hlist_add_after_rcu(struct hlist_node *prev,
struct hlist_node *n)
{
n->next = prev->next;
n->pprev = &prev->next;
smp_wmb();
prev->next = n;
if (n->next)
n->next->pprev = &n->next;
}

#define hlist_entry(ptr, type, member) container_of(ptr,type,member)

#define hlist_for_each(pos, head) \
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv4/fib_lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

struct fib_alias {
struct list_head fa_list;
struct rcu_head rcu;
struct fib_info *fa_info;
u8 fa_tos;
u8 fa_type;
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/ipv4/fib_semantics.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,14 +854,15 @@ fib_create_info(const struct rtmsg *r, struct kern_rta *rta,
return NULL;
}

/* Note! fib_semantic_match intentionally uses RCU list functions. */
int fib_semantic_match(struct list_head *head, const struct flowi *flp,
struct fib_result *res, __u32 zone, __u32 mask,
int prefixlen)
{
struct fib_alias *fa;
int nh_sel = 0;

list_for_each_entry(fa, head, fa_list) {
list_for_each_entry_rcu(fa, head, fa_list) {
int err;

if (fa->fa_tos &&
Expand Down

0 comments on commit 9f41f41

Please sign in to comment.