#include <linux/cpu.h>
#include <linux/mm.h>
-#include "../../wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */
+#include "../../wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "../../wrapper/ringbuffer/config.h"
#include "../../wrapper/ringbuffer/backend.h"
#include "../../wrapper/ringbuffer/frontend.h"
return -EPERM;
/* Check that the subbuffer size is larger than a page. */
- CHAN_WARN_ON(chanb, subbuf_size < PAGE_SIZE);
+ if (subbuf_size < PAGE_SIZE)
+ return -EINVAL;
/*
* Make sure the number of subbuffers and subbuffer size are power of 2.
struct channel_backend *chanb = &bufb->chan->backend;
const struct lib_ring_buffer_config *config = chanb->config;
size_t index;
- ssize_t pagecpy, orig_len;
+ ssize_t pagecpy;
struct lib_ring_buffer_backend_pages *rpages;
unsigned long sb_bindex, id;
- orig_len = len;
offset &= chanb->buf_size - 1;
index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
if (unlikely(!len))