Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2353
b: refs/heads/master
c: 8b0c250
h: refs/heads/master
i:
  2351: adddd58
v: v3
  • Loading branch information
mochel@digitalimplant.org authored and Greg Kroah-Hartman committed Jun 20, 2005
1 parent 45b273a commit e0c36b2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2287c322b61fced7e0c326a1a9606aa73147e3df
refs/heads/master: 8b0c250be489dcbf1a3a33bb4ec4c7f33735a365
2 changes: 2 additions & 0 deletions trunk/include/linux/klist.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ extern void klist_add_head(struct klist * k, struct klist_node * n);
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;
Expand Down
16 changes: 16 additions & 0 deletions trunk/lib/klist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -246,3 +260,5 @@ struct klist_node * klist_next(struct klist_iter * i)
}

EXPORT_SYMBOL_GPL(klist_next);


0 comments on commit e0c36b2

Please sign in to comment.