patch-2.4.0-test6 linux/include/linux/list.h

Next file: linux/include/linux/mm.h
Previous file: linux/include/linux/jffs.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test5/linux/include/linux/list.h linux/include/linux/list.h
@@ -85,10 +85,21 @@
 /**
  * list_del - deletes entry from list.
  * @entry: the element to delete from the list.
+ * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
  */
 static __inline__ void list_del(struct list_head *entry)
 {
 	__list_del(entry->prev, entry->next);
+}
+
+/**
+ * list_del_init - deletes entry from list and reinitialize it.
+ * @entry: the element to delete from the list.
+ */
+static __inline__ void list_del_init(struct list_head *entry)
+{
+	__list_del(entry->prev, entry->next);
+	INIT_LIST_HEAD(entry); 
 }
 
 /**

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)