1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-08-01 00:22:02 +03:00

make list_move consistent with other list fns

This commit is contained in:
Alasdair Kergon
2008-04-10 19:14:27 +00:00
parent 55ea8590ae
commit 0b2a795ece
7 changed files with 28 additions and 20 deletions

View File

@ -65,6 +65,15 @@ void list_del(struct list *elem)
elem->p->n = elem->n;
}
/*
* Remove an element from existing list and insert before 'head'.
*/
void list_move(struct list *head, struct list *elem)
{
list_del(elem);
list_add(head, elem);
}
/*
* Is the list empty?
*/

View File

@ -55,14 +55,9 @@ void list_add_h(struct list *head, struct list *elem);
void list_del(struct list *elem);
/*
* Move an element from an existing list to list 'head'.
* Insert the element before 'head'.
* Remove an element from existing list and insert before 'head'.
*/
static inline void list_move(struct list *item, struct list *head)
{
list_del(item);
list_add(head, item);
}
void list_move(struct list *head, struct list *elem);
/*
* Is the list empty?