* Dual LGPL v2.1/GPL v2 license.
*/
-#include <linux/vmalloc.h>
#include <linux/stddef.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/cpu.h>
#include <linux/mm.h>
+#include "../../wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "../../wrapper/ringbuffer/config.h"
#include "../../wrapper/ringbuffer/backend.h"
#include "../../wrapper/ringbuffer/frontend.h"
* If kmalloc ever uses vmalloc underneath, make sure the buffer pages
* will not fault.
*/
- vmalloc_sync_all();
+ wrapper_vmalloc_sync_all();
kfree(virt);
kfree(pages);
return 0;
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))