]>
git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - include/linux/klist.h
2 * klist.h - Some generic list helpers, extending struct list_head a bit.
4 * Implementations are found in lib/klist.c
7 * Copyright (C) 2005 Patrick Mochel
9 * This file is rleased under the GPL v2.
12 #ifndef _LINUX_KLIST_H
13 #define _LINUX_KLIST_H
15 #include <linux/spinlock.h>
16 #include <linux/completion.h>
17 #include <linux/kref.h>
18 #include <linux/list.h>
23 struct list_head k_list
;
27 extern void klist_init(struct klist
* k
);
31 struct klist
* n_klist
;
32 struct list_head n_node
;
34 struct completion n_removed
;
37 extern void klist_add_tail(struct klist_node
* n
, struct klist
* k
);
38 extern void klist_add_head(struct klist_node
* n
, struct klist
* k
);
40 extern void klist_del(struct klist_node
* n
);
41 extern void klist_remove(struct klist_node
* n
);
43 extern int klist_node_attached(struct klist_node
* n
);
47 struct klist
* i_klist
;
48 struct list_head
* i_head
;
49 struct klist_node
* i_cur
;
53 extern void klist_iter_init(struct klist
* k
, struct klist_iter
* i
);
54 extern void klist_iter_init_node(struct klist
* k
, struct klist_iter
* i
,
55 struct klist_node
* n
);
56 extern void klist_iter_exit(struct klist_iter
* i
);
57 extern struct klist_node
* klist_next(struct klist_iter
* i
);