ptr_ring: fix build

Fixes after recent use of kvmalloc

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Michael S. Tsirkin 2018-03-20 02:41:04 +02:00
parent 0c8efd610b
commit c8f06a0668
1 changed files with 5 additions and 0 deletions

View File

@ -17,6 +17,8 @@
#define likely(x) (__builtin_expect(!!(x), 1))
#define ALIGN(x, a) (((x) + (a) - 1) / (a) * (a))
#define SIZE_MAX (~(size_t)0)
#define KMALLOC_MAX_SIZE SIZE_MAX
#define BUG_ON(x) assert(x)
typedef pthread_spinlock_t spinlock_t;
@ -57,6 +59,9 @@ static void kfree(void *p)
free(p);
}
#define kvmalloc_array kmalloc_array
#define kvfree kfree
static void spin_lock_init(spinlock_t *lock)
{
int r = pthread_spin_init(lock, 0);