diff options
Diffstat (limited to 'include/linux/klist.h')
-rw-r--r-- | include/linux/klist.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/klist.h b/include/linux/klist.h index eebf5e5696ec..74071254c9d3 100644 --- a/include/linux/klist.h +++ b/include/linux/klist.h | |||
@@ -9,20 +9,25 @@ | |||
9 | * This file is rleased under the GPL v2. | 9 | * This file is rleased under the GPL v2. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef _LINUX_KLIST_H | ||
13 | #define _LINUX_KLIST_H | ||
14 | |||
12 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
13 | #include <linux/completion.h> | 16 | #include <linux/completion.h> |
14 | #include <linux/kref.h> | 17 | #include <linux/kref.h> |
15 | #include <linux/list.h> | 18 | #include <linux/list.h> |
16 | 19 | ||
17 | 20 | struct klist_node; | |
18 | struct klist { | 21 | struct klist { |
19 | spinlock_t k_lock; | 22 | spinlock_t k_lock; |
20 | struct list_head k_list; | 23 | struct list_head k_list; |
24 | void (*get)(struct klist_node *); | ||
25 | void (*put)(struct klist_node *); | ||
21 | }; | 26 | }; |
22 | 27 | ||
23 | 28 | ||
24 | extern void klist_init(struct klist * k); | 29 | extern void klist_init(struct klist * k, void (*get)(struct klist_node *), |
25 | 30 | void (*put)(struct klist_node *)); | |
26 | 31 | ||
27 | struct klist_node { | 32 | struct klist_node { |
28 | struct klist * n_klist; | 33 | struct klist * n_klist; |
@@ -31,8 +36,8 @@ struct klist_node { | |||
31 | struct completion n_removed; | 36 | struct completion n_removed; |
32 | }; | 37 | }; |
33 | 38 | ||
34 | extern void klist_add_tail(struct klist * k, struct klist_node * n); | 39 | extern void klist_add_tail(struct klist_node * n, struct klist * k); |
35 | extern void klist_add_head(struct klist * k, struct klist_node * n); | 40 | extern void klist_add_head(struct klist_node * n, struct klist * k); |
36 | 41 | ||
37 | extern void klist_del(struct klist_node * n); | 42 | extern void klist_del(struct klist_node * n); |
38 | extern void klist_remove(struct klist_node * n); | 43 | extern void klist_remove(struct klist_node * n); |
@@ -53,3 +58,4 @@ extern void klist_iter_init_node(struct klist * k, struct klist_iter * i, | |||
53 | extern void klist_iter_exit(struct klist_iter * i); | 58 | extern void klist_iter_exit(struct klist_iter * i); |
54 | extern struct klist_node * klist_next(struct klist_iter * i); | 59 | extern struct klist_node * klist_next(struct klist_iter * i); |
55 | 60 | ||
61 | #endif | ||