]> git.baikalelectronics.ru Git - kernel.git/commit
ring-buffer: make ring_buffer_read_page read from start on partial page
authorSteven Rostedt <srostedt@redhat.com>
Wed, 4 Mar 2009 00:51:40 +0000 (19:51 -0500)
committerSteven Rostedt <srostedt@redhat.com>
Wed, 4 Mar 2009 01:52:27 +0000 (20:52 -0500)
commit90a5ff663f2daf913ee24944250328c5878c127c
tree674376b2f7a45cf6558879a4985398397dc96e79
parenta22595ff249b6059ae83bb9112fffea6904ea0da
ring-buffer: make ring_buffer_read_page read from start on partial page

Impact: dont leave holes in read buffer page

The ring_buffer_read_page swaps a given page with the reader page
of the ring buffer, if certain conditions are set:

 1) requested length is big enough to hold entire page data

 2) a writer is not currently on the page

 3) the page is not partially consumed.

Instead of swapping with the supplied page. It copies the data to
the supplied page instead. But currently the data is copied in the
same offset as the source page. This causes a hole at the start
of the reader page. This complicates the use of this function.
Instead, it should copy the data at the beginning of the function
and update the index fields accordingly.

Other small clean ups are also done in this patch.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
kernel/trace/ring_buffer.c