projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: handle large number of pages or subbuffers per buffer
[lttng-modules.git]
/
lib
/
ringbuffer
/
ring_buffer_mmap.c
diff --git
a/lib/ringbuffer/ring_buffer_mmap.c
b/lib/ringbuffer/ring_buffer_mmap.c
index ec7d9530fd968544ad4ce0b5a70a1740545621ef..35d30e7ec75d2426d4b74f3debb3466eb07b74ba 100644
(file)
--- a/
lib/ringbuffer/ring_buffer_mmap.c
+++ b/
lib/ringbuffer/ring_buffer_mmap.c
@@
-25,9
+25,9
@@
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/mm.h>
-#include
"../../wrapper/ringbuffer/backend.h"
-#include
"../../wrapper/ringbuffer/frontend.h"
-#include
"../../wrapper/ringbuffer/vfs.h"
+#include
<wrapper/ringbuffer/backend.h>
+#include
<wrapper/ringbuffer/frontend.h>
+#include
<wrapper/ringbuffer/vfs.h>
/*
* fault() vm_op implementation for ring buffer file mapping.
/*
* fault() vm_op implementation for ring buffer file mapping.
@@
-38,7
+38,7
@@
static int lib_ring_buffer_fault(struct vm_area_struct *vma, struct vm_fault *vm
struct channel *chan = buf->backend.chan;
const struct lib_ring_buffer_config *config = &chan->backend.config;
pgoff_t pgoff = vmf->pgoff;
struct channel *chan = buf->backend.chan;
const struct lib_ring_buffer_config *config = &chan->backend.config;
pgoff_t pgoff = vmf->pgoff;
-
struct page **page
;
+
unsigned long *pfnp
;
void **virt;
unsigned long offset, sb_bindex;
void **virt;
unsigned long offset, sb_bindex;
@@
-53,14
+53,14
@@
static int lib_ring_buffer_fault(struct vm_area_struct *vma, struct vm_fault *vm
buf->backend.chan->backend.subbuf_size))
return VM_FAULT_SIGBUS;
/*
buf->backend.chan->backend.subbuf_size))
return VM_FAULT_SIGBUS;
/*
- * ring_buffer_read_get_p
age() gets the page in the current reader's
- * pages.
+ * ring_buffer_read_get_p
fn() gets the page frame number for the
+ *
current reader's
pages.
*/
*/
- p
age = lib_ring_buffer_read_get_page
(&buf->backend, offset, &virt);
- if (!*p
age
)
+ p
fnp = lib_ring_buffer_read_get_pfn
(&buf->backend, offset, &virt);
+ if (!*p
fnp
)
return VM_FAULT_SIGBUS;
return VM_FAULT_SIGBUS;
- get_page(
*page
);
- vmf->page =
*page
;
+ get_page(
pfn_to_page(*pfnp)
);
+ vmf->page =
pfn_to_page(*pfnp)
;
return 0;
}
return 0;
}
@@
-106,16
+106,23
@@
static int lib_ring_buffer_mmap_buf(struct lib_ring_buffer *buf,
return 0;
}
return 0;
}
+int lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma,
+ struct lib_ring_buffer *buf)
+{
+ return lib_ring_buffer_mmap_buf(buf, vma);
+}
+EXPORT_SYMBOL_GPL(lib_ring_buffer_mmap);
+
/**
/**
- * lib_ring_buffer_mmap - mmap file op
+ *
vfs_
lib_ring_buffer_mmap - mmap file op
* @filp: the file
* @vma: the vma describing what to map
*
* Calls upon lib_ring_buffer_mmap_buf() to map the file into user space.
*/
* @filp: the file
* @vma: the vma describing what to map
*
* Calls upon lib_ring_buffer_mmap_buf() to map the file into user space.
*/
-int lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma)
+int
vfs_
lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma)
{
struct lib_ring_buffer *buf = filp->private_data;
{
struct lib_ring_buffer *buf = filp->private_data;
- return lib_ring_buffer_mmap
_buf(buf, vma
);
+ return lib_ring_buffer_mmap
(filp, vma, buf
);
}
}
-EXPORT_SYMBOL_GPL(lib_ring_buffer_mmap);
+EXPORT_SYMBOL_GPL(
vfs_
lib_ring_buffer_mmap);
This page took
0.024579 seconds
and
4
git commands to generate.