ddk: 3.17-rc1
git-svn-id: svn://kolibrios.org@5056 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -40,7 +40,7 @@ static inline void __list_add_rcu(struct list_head *new,
|
||||
next->prev = new;
|
||||
}
|
||||
#else
|
||||
extern void __list_add_rcu(struct list_head *new,
|
||||
void __list_add_rcu(struct list_head *new,
|
||||
struct list_head *prev, struct list_head *next);
|
||||
#endif
|
||||
|
||||
@@ -191,7 +191,11 @@ static inline void list_splice_init_rcu(struct list_head *list,
|
||||
if (list_empty(list))
|
||||
return;
|
||||
|
||||
/* "first" and "last" tracking list, so initialize it. */
|
||||
/*
|
||||
* "first" and "last" tracking list, so initialize it. RCU readers
|
||||
* have access to this list, so we must use INIT_LIST_HEAD_RCU()
|
||||
* instead of INIT_LIST_HEAD().
|
||||
*/
|
||||
|
||||
INIT_LIST_HEAD(list);
|
||||
|
||||
@@ -228,9 +232,10 @@ static inline void list_splice_init_rcu(struct list_head *list,
|
||||
* primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
|
||||
*/
|
||||
#define list_entry_rcu(ptr, type, member) \
|
||||
({typeof (*ptr) __rcu *__ptr = (typeof (*ptr) __rcu __force *)ptr; \
|
||||
({ \
|
||||
typeof(*ptr) __rcu *__ptr = (typeof(*ptr) __rcu __force *)ptr; \
|
||||
container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* Where are list_empty_rcu() and list_first_entry_rcu()?
|
||||
@@ -266,11 +271,11 @@ static inline void list_splice_init_rcu(struct list_head *list,
|
||||
* primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
|
||||
*/
|
||||
#define list_first_or_null_rcu(ptr, type, member) \
|
||||
({struct list_head *__ptr = (ptr); \
|
||||
({ \
|
||||
struct list_head *__ptr = (ptr); \
|
||||
struct list_head *__next = ACCESS_ONCE(__ptr->next); \
|
||||
likely(__ptr != __next) ? \
|
||||
list_entry_rcu(__next, type, member) : NULL; \
|
||||
})
|
||||
likely(__ptr != __next) ? list_entry_rcu(__next, type, member) : NULL; \
|
||||
})
|
||||
|
||||
/**
|
||||
* list_for_each_entry_rcu - iterate over rcu list of given type
|
||||
@@ -412,9 +417,9 @@ static inline void hlist_add_before_rcu(struct hlist_node *n,
|
||||
}
|
||||
|
||||
/**
|
||||
* hlist_add_after_rcu
|
||||
* @prev: the existing element to add the new element after.
|
||||
* hlist_add_behind_rcu
|
||||
* @n: the new element to add to the hash list.
|
||||
* @prev: the existing element to add the new element after.
|
||||
*
|
||||
* Description:
|
||||
* Adds the specified element to the specified hlist
|
||||
@@ -429,8 +434,8 @@ static inline void hlist_add_before_rcu(struct hlist_node *n,
|
||||
* hlist_for_each_entry_rcu(), used to prevent memory-consistency
|
||||
* problems on Alpha CPUs.
|
||||
*/
|
||||
static inline void hlist_add_after_rcu(struct hlist_node *prev,
|
||||
struct hlist_node *n)
|
||||
static inline void hlist_add_behind_rcu(struct hlist_node *n,
|
||||
struct hlist_node *prev)
|
||||
{
|
||||
n->next = prev->next;
|
||||
n->pprev = &prev->next;
|
||||
|
Reference in New Issue
Block a user