--- linux-2.6.8.1/include/linux/list.h 2004-08-14 19:55:33.000000000 +0900 +++ linux-2.6.8.1.rcu/include/linux/list.h 2004-08-20 18:04:10.000000000 +0900 @@ -194,8 +194,23 @@ __list_del(entry->prev, entry->next); entry->prev = LIST_POISON2; } +/* + * list_replace_rcu - replace old entry by new onw from list + * @old : the element to be replaced from the list. + * @new : the new element to insert to the list. + * + * The old entry will be replaced to the new entry atomically. + */ +static inline void list_replace_rcu(struct list_head *old, struct list_head *new){ + new->next = old->next; + new->prev = old->prev; + smp_wmb(); + new->next->prev = new; + new->prev->next = new; +} + /** * list_del_init - deletes entry from list and reinitialize it. * @entry: the element to delete from the list. */