/* Copyright (c) 2016 Facebook * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. */#ifndef __PERCPU_FREELIST_H__#define __PERCPU_FREELIST_H__#include <linux/spinlock.h>#include <linux/percpu.h>structpcpu_freelist_head{structpcpu_freelist_node*first;raw_spinlock_tlock;};structpcpu_freelist{structpcpu_freelist_head__percpu*freelist;};structpcpu_freelist_node{structpcpu_freelist_node*next;};voidpcpu_freelist_push(structpcpu_freelist*,structpcpu_freelist_node*);structpcpu_freelist_node*pcpu_freelist_pop(structpcpu_freelist*);voidpcpu_freelist_populate(structpcpu_freelist*s,void*buf,u32elem_size,u32nr_elems);intpcpu_freelist_init(structpcpu_freelist*);voidpcpu_freelist_destroy(structpcpu_freelist*s);#endif