| 1 |
|
| 2 | |
| 3 |
|
| 4 | #ifndef __PERCPU_FREELIST_H__
|
| 5 | #define __PERCPU_FREELIST_H__
|
| 6 | #include <linux/spinlock.h>
|
| 7 | #include <linux/percpu.h>
|
| 8 | #include <asm/rqspinlock.h>
|
| 9 |
|
| 10 | struct pcpu_freelist_head {
|
| 11 | struct pcpu_freelist_node *first;
|
| 12 | rqspinlock_t lock;
|
| 13 | };
|
| 14 |
|
| 15 | struct pcpu_freelist {
|
| 16 | struct pcpu_freelist_head __percpu *freelist;
|
| 17 | struct pcpu_freelist_head extralist;
|
| 18 | };
|
| 19 |
|
| 20 | struct pcpu_freelist_node {
|
| 21 | struct pcpu_freelist_node *next;
|
| 22 | };
|
| 23 |
|
| 24 |
|
| 25 | void pcpu_freelist_push(struct pcpu_freelist *, struct pcpu_freelist_node *);
|
| 26 | struct pcpu_freelist_node *pcpu_freelist_pop(struct pcpu_freelist *);
|
| 27 |
|
| 28 | void __pcpu_freelist_push(struct pcpu_freelist *, struct pcpu_freelist_node *);
|
| 29 | struct pcpu_freelist_node *__pcpu_freelist_pop(struct pcpu_freelist *);
|
| 30 | void pcpu_freelist_populate(struct pcpu_freelist *s, void *buf, u32 elem_size,
|
| 31 | u32 nr_elems);
|
| 32 | int pcpu_freelist_init(struct pcpu_freelist *);
|
| 33 | void pcpu_freelist_destroy(struct pcpu_freelist *s);
|
| 34 | #endif
|