diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-24 08:41:41 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-24 13:07:53 -0400 |
commit | 816724e65c72a90a44fbad0ef0b59b186c85fa90 (patch) | |
tree | 421fa29aedff988e392f92780637553e275d37a0 /include/linux/list.h | |
parent | 70ac4385a13f78bc478f26d317511893741b05bd (diff) | |
parent | d384ea691fe4ea8c2dd5b9b8d9042eb181776f18 (diff) |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Conflicts:
fs/nfs/inode.c
fs/super.c
Fix conflicts between patch 'NFS: Split fs/nfs/inode.c' and patch
'VFS: Permit filesystem to override root dentry on mount'
Diffstat (limited to 'include/linux/list.h')
-rw-r--r-- | include/linux/list.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index 76f05718342c..a02642e4710a 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -197,12 +197,35 @@ static inline void list_del_rcu(struct list_head *entry) | |||
197 | entry->prev = LIST_POISON2; | 197 | entry->prev = LIST_POISON2; |
198 | } | 198 | } |
199 | 199 | ||
200 | /** | ||
201 | * list_replace - replace old entry by new one | ||
202 | * @old : the element to be replaced | ||
203 | * @new : the new element to insert | ||
204 | * Note: if 'old' was empty, it will be overwritten. | ||
205 | */ | ||
206 | static inline void list_replace(struct list_head *old, | ||
207 | struct list_head *new) | ||
208 | { | ||
209 | new->next = old->next; | ||
210 | new->next->prev = new; | ||
211 | new->prev = old->prev; | ||
212 | new->prev->next = new; | ||
213 | } | ||
214 | |||
215 | static inline void list_replace_init(struct list_head *old, | ||
216 | struct list_head *new) | ||
217 | { | ||
218 | list_replace(old, new); | ||
219 | INIT_LIST_HEAD(old); | ||
220 | } | ||
221 | |||
200 | /* | 222 | /* |
201 | * list_replace_rcu - replace old entry by new one | 223 | * list_replace_rcu - replace old entry by new one |
202 | * @old : the element to be replaced | 224 | * @old : the element to be replaced |
203 | * @new : the new element to insert | 225 | * @new : the new element to insert |
204 | * | 226 | * |
205 | * The old entry will be replaced with the new entry atomically. | 227 | * The old entry will be replaced with the new entry atomically. |
228 | * Note: 'old' should not be empty. | ||
206 | */ | 229 | */ |
207 | static inline void list_replace_rcu(struct list_head *old, | 230 | static inline void list_replace_rcu(struct list_head *old, |
208 | struct list_head *new) | 231 | struct list_head *new) |