* Only read source character once, in case it is
* modified concurrently.
*/
- c = READ_ONCE(src[count]);
+ c = LTTNG_READ_ONCE(src[count]);
if (!c)
break;
lib_ring_buffer_do_copy(config, &dest[count], &c, 1);
size_t offset = ctx->buf_offset;
struct lib_ring_buffer_backend_pages *backend_pages;
unsigned long ret;
- mm_segment_t old_fs = get_fs();
if (unlikely(!len))
return;
index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
pagecpy = min_t(size_t, len, (-offset) & ~PAGE_MASK);
- set_fs(KERNEL_DS);
pagefault_disable();
if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
goto fill_buffer;
_lib_ring_buffer_copy_from_user_inatomic(bufb, offset, src, len, 0);
}
pagefault_enable();
- set_fs(old_fs);
ctx->buf_offset += len;
return;
fill_buffer:
pagefault_enable();
- set_fs(old_fs);
/*
* In the error path we call the slow path version to avoid
* the pollution of static inline code.
size_t index, pagecpy;
size_t offset = ctx->buf_offset;
struct lib_ring_buffer_backend_pages *backend_pages;
- mm_segment_t old_fs = get_fs();
if (unlikely(!len))
return;
index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
pagecpy = min_t(size_t, len, (-offset) & ~PAGE_MASK);
- set_fs(KERNEL_DS);
pagefault_disable();
if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
goto fill_buffer;
len, 0, pad);
}
pagefault_enable();
- set_fs(old_fs);
ctx->buf_offset += len;
return;
fill_buffer:
pagefault_enable();
- set_fs(old_fs);
/*
* In the error path we call the slow path version to avoid
* the pollution of static inline code.
unsigned long len)
{
unsigned long ret;
- mm_segment_t old_fs;
if (!lttng_access_ok(VERIFY_READ, src, len))
return 1;
- old_fs = get_fs();
- set_fs(KERNEL_DS);
pagefault_disable();
ret = __copy_from_user_inatomic(dest, src, len);
pagefault_enable();
- set_fs(old_fs);
return ret;
}