lkml.org 
[lkml]   [2005]   [Mar]   [25]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateThu, 24 Mar 2005 21:54:33 -0800 (PST)
FromPatrick Mochel <>
Subject[3/12] More Driver Model Locking Changes
ChangeSet@1.2241, 2005-03-24 12:58:57-08:00, mochel@digitalimplant.org
  [klist] add klist_node_attached() to determine if a node is on a list or not.


  Signed-off-by: Patrick Mochel <mochel@digitalimplant.org>

diff -Nru a/include/linux/klist.h b/include/linux/klist.h
--- a/include/linux/klist.h	2005-03-24 20:33:45 -08:00
+++ b/include/linux/klist.h	2005-03-24 20:33:45 -08:00
@@ -37,6 +37,8 @@
 extern void klist_del(struct klist_node * n);
 extern void klist_remove(struct klist_node * n);

+extern int klist_node_attached(struct klist_node * n);
+

 struct klist_iter {
 	struct klist		* i_klist;
diff -Nru a/lib/klist.c b/lib/klist.c
--- a/lib/klist.c	2005-03-24 20:33:45 -08:00
+++ b/lib/klist.c	2005-03-24 20:33:45 -08:00
@@ -112,6 +112,7 @@
 	struct klist_node * n = container_of(kref, struct klist_node, n_ref);
 	list_del(&n->n_node);
 	complete(&n->n_removed);
+	n->n_klist = NULL;
 }

 static int klist_dec_and_del(struct klist_node * n)
@@ -154,6 +155,19 @@


 /**
+ *	klist_node_attached - Say whether a node is bound to a list or not.
+ *	@n:	Node that we're testing.
+ */
+
+int klist_node_attached(struct klist_node * n)
+{
+	return (n->n_klist != NULL);
+}
+
+EXPORT_SYMBOL_GPL(klist_node_attached);
+
+
+/**
  *	klist_iter_init_node - Initialize a klist_iter structure.
  *	@k:	klist we're iterating.
  *	@i:	klist_iter we're filling.
@@ -246,3 +260,5 @@
 }

 EXPORT_SYMBOL_GPL(klist_next);
+
+
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-04-06 11:30    [from the cache]
©2003-2008