diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2009-12-15 12:07:30 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2009-12-15 12:07:30 -0500 |
| commit | aa55e0cbed12e14820aa4deab7e8d006be4454dc (patch) | |
| tree | ab0432f1e2d549e63c45246d8fe715c38007df75 | |
| parent | 0c20bff197ce10fd2e2957324c4c675e2a01f8a3 (diff) | |
Simplify free_page()
Both read and mmap do the same thing except the mmap version
needs to unmap the page on free. The condition should hold
the mmap version.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| -rw-r--r-- | trace-input.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/trace-input.c b/trace-input.c index 198d596..f967591 100644 --- a/trace-input.c +++ b/trace-input.c | |||
| @@ -498,12 +498,9 @@ static void free_page(struct tracecmd_input *handle, int cpu) | |||
| 498 | if (!handle->cpu_data[cpu].page) | 498 | if (!handle->cpu_data[cpu].page) |
| 499 | return; | 499 | return; |
| 500 | 500 | ||
| 501 | if (handle->read_page) { | 501 | if (!handle->read_page) |
| 502 | handle->cpu_data[cpu].page = NULL; | 502 | munmap(handle->cpu_data[cpu].page, handle->page_size); |
| 503 | return; | 503 | |
| 504 | } | ||
| 505 | |||
| 506 | munmap(handle->cpu_data[cpu].page, handle->page_size); | ||
| 507 | handle->cpu_data[cpu].page = NULL; | 504 | handle->cpu_data[cpu].page = NULL; |
| 508 | } | 505 | } |
| 509 | 506 | ||
