The page faults don't need to be disabled for access_ok. Simplify the
fill buffer error paths.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I2e31d308d45efdfede04e2159c37c066749871ae
index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
pagecpy = min_t(size_t, len, (-offset) & ~PAGE_MASK);
index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
pagecpy = min_t(size_t, len, (-offset) & ~PAGE_MASK);
if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
goto fill_buffer;
if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
goto fill_buffer;
if (likely(pagecpy == len)) {
ret = lib_ring_buffer_do_copy_from_user_inatomic(
backend_pages->p[index].virt + (offset & ~PAGE_MASK),
src, len);
if (unlikely(ret > 0)) {
/* Copy failed. */
if (likely(pagecpy == len)) {
ret = lib_ring_buffer_do_copy_from_user_inatomic(
backend_pages->p[index].virt + (offset & ~PAGE_MASK),
src, len);
if (unlikely(ret > 0)) {
/* Copy failed. */
+ goto fill_buffer_enable_pf;
}
} else {
_lib_ring_buffer_copy_from_user_inatomic(bufb, offset, src, len, 0);
}
} else {
_lib_ring_buffer_copy_from_user_inatomic(bufb, offset, src, len, 0);
/*
* In the error path we call the slow path version to avoid
* the pollution of static inline code.
/*
* In the error path we call the slow path version to avoid
* the pollution of static inline code.
index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
pagecpy = min_t(size_t, len, (-offset) & ~PAGE_MASK);
index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
pagecpy = min_t(size_t, len, (-offset) & ~PAGE_MASK);
if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
goto fill_buffer;
if (unlikely(!lttng_access_ok(VERIFY_READ, src, len)))
goto fill_buffer;
if (likely(pagecpy == len)) {
size_t count;
if (likely(pagecpy == len)) {
size_t count;
/*
* In the error path we call the slow path version to avoid
* the pollution of static inline code.
/*
* In the error path we call the slow path version to avoid
* the pollution of static inline code.