X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=lib%2Fringbuffer%2Fring_buffer_backend.c;h=a9513d1c07e3072fc9e6f6dcd5418554a1af8255;hb=cac8f1aa8774b81f6fe72f670a9413d9287db263;hp=f9ec3d1e2327b3f16e79f1c8e0c47e576b495e38;hpb=f3bc08c50e1b302bceea699027d889fd6d9af525;p=lttng-modules.git diff --git a/lib/ringbuffer/ring_buffer_backend.c b/lib/ringbuffer/ring_buffer_backend.c index f9ec3d1e..a9513d1c 100644 --- a/lib/ringbuffer/ring_buffer_backend.c +++ b/lib/ringbuffer/ring_buffer_backend.c @@ -6,7 +6,6 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include #include #include #include @@ -17,6 +16,7 @@ #include #include +#include "../../wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ #include "../../wrapper/ringbuffer/config.h" #include "../../wrapper/ringbuffer/backend.h" #include "../../wrapper/ringbuffer/frontend.h" @@ -131,7 +131,7 @@ int lib_ring_buffer_backend_allocate(const struct lib_ring_buffer_config *config * 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; @@ -311,7 +311,8 @@ int channel_backend_init(struct channel_backend *chanb, 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. @@ -568,11 +569,10 @@ int __lib_ring_buffer_copy_to_user(struct lib_ring_buffer_backend *bufb, 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))