modprobe and lists

Bernhard Fischer rep.nop at aon.at
Fri May 19 12:12:19 UTC 2006


On Fri, May 19, 2006 at 01:35:02PM +0200, Yann E. MORIN wrote:
>Hello all!
>
>modprobe is making use of lists, both single- and double-linked lists.
>Currently, modprobe is implementing is own list management, when we have
>(at least) single-linked list management in libbb.
>
>1) Would it be desireable that libbb implements both lists?

I tend to think having both in libbb is worthwhile.

Apart from modprobe, which other applet(s) need doubly-linked lists?


>2) "llist" stands for "linked list". Should we add reverse link to that type
>   or create "dllist" (standing fo "doubly-linked list") ?

What about
Index: include/libbb.h
===================================================================
--- include/libbb.h	(revision 15121)
+++ include/libbb.h	(working copy)
@@ -473,7 +473,10 @@
 
 typedef struct llist_s {
 	char *data;
-	struct llist_s *link;
+	struct llist_s *next;
+#ifdef __NEED_DLLIST
+	struct llist_s *prev;
+#endif
 } llist_t;
 extern llist_t *llist_add_to(llist_t *old_head, char *new_item);
 extern llist_t *llist_add_to_end(llist_t *list_head, char *data);

>
>Once these two questions are answered, I'll code that, and submit a libbb
>patch.
>
>Next, I'll work these lists into modprobe, and submit a patch.



More information about the busybox mailing list