X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lib%2Fringbuffer%2Fbackend.h;h=a1a532eb341f53053752c2106cb9c202ee59daeb;hb=9d209ed112e998bf21c5df6d013635367b886ba2;hp=3f8c108141521073c930661244ed376769cf137f;hpb=c9b7e9c8cee5e9ee5f8a9288bb77d2b52deed077;p=lttng-modules.git diff --git a/lib/ringbuffer/backend.h b/lib/ringbuffer/backend.h index 3f8c1081..a1a532eb 100644 --- a/lib/ringbuffer/backend.h +++ b/lib/ringbuffer/backend.h @@ -290,7 +290,6 @@ void lib_ring_buffer_copy_from_user_inatomic(const struct lib_ring_buffer_config 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; @@ -300,7 +299,6 @@ void lib_ring_buffer_copy_from_user_inatomic(const struct lib_ring_buffer_config 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; @@ -317,14 +315,12 @@ void lib_ring_buffer_copy_from_user_inatomic(const struct lib_ring_buffer_config _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. @@ -360,7 +356,6 @@ void lib_ring_buffer_strcpy_from_user_inatomic(const struct lib_ring_buffer_conf 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; @@ -370,7 +365,6 @@ void lib_ring_buffer_strcpy_from_user_inatomic(const struct lib_ring_buffer_conf 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; @@ -401,14 +395,12 @@ void lib_ring_buffer_strcpy_from_user_inatomic(const struct lib_ring_buffer_conf 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. @@ -460,16 +452,12 @@ unsigned long lib_ring_buffer_copy_from_user_check_nofault(void *dest, 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; }