[Stgt-devel] [PATCH 06/20] iser list del init

Pete Wyckoff pw
Tue Oct 16 17:19:07 CEST 2007


Add this handy function for removing an item from a list and
initializing its list pointers.

Signed-off-by: Pete Wyckoff <pw at osc.edu>
---
 usr/list.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/usr/list.h b/usr/list.h
index 3e85c9b..d2e0019 100644
--- a/usr/list.h
+++ b/usr/list.h
@@ -83,4 +83,10 @@ static inline void list_del(struct list_head *entry)
 	entry->next = entry->prev = NULL;
 }
 
+static inline void list_del_init(struct list_head *entry)
+{
+	__list_del(entry->prev, entry->next);
+	INIT_LIST_HEAD(entry);
+}
+
 #endif
-- 
1.5.3.4




More information about the stgt mailing list