author: mochel@digitalimplant.org <mochel@digitalimplant.org> 2005-03-24 12:58:57 -0800
committer: Greg Kroah-Hartman <gregkh@suse.de> 2005-06-20 15:15:17 -0700
commit: 8b0c250be489dcbf1a3a33bb4ec4c7f33735a365
parent: 2287c322b61fced7e0c326a1a9606aa73147e3df
Commit Summary:
Diffstat:
1 file changed, 11 insertions, 0 deletions
diff --git a/lib/klist.c b/lib/klist.c
index 6f760424648b..02177d72dc89 100644
--- a/lib/klist.c
+++ b/lib/klist.c
@@ -112,6 +112,7 @@ static void klist_release(struct kref * kref)
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)
@@ -153,6 +154,19 @@ void klist_remove(struct klist_node * n)
EXPORT_SYMBOL_GPL(klist_remove);
+/**
+ * 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.
@@ -246,3 +260,5 @@ struct klist_node * klist_next(struct klist_iter * i)
}
EXPORT_SYMBOL_GPL(klist_next);
+
+