Module: xenomai-head Branch: master Commit: 518a20952b778463ffedb88ce645b53e23058ae1 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=518a20952b778463ffedb88ce645b53e23058ae1
Author: Jan Kiszka <jan.kis...@siemens.com> Date: Mon Nov 9 20:37:08 2009 +0100 nucleus: Track heap mapping on to mm-clone When the mm is cloned (due to fork), the heap mapping counter need to be updated as well. Register an open callback with the vm-ops for this purpose. Signed-off-by: Jan Kiszka <jan.kis...@siemens.com> --- ksrc/nucleus/heap.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/ksrc/nucleus/heap.c b/ksrc/nucleus/heap.c index b5fb1cd..27a4ad7 100644 --- a/ksrc/nucleus/heap.c +++ b/ksrc/nucleus/heap.c @@ -1017,6 +1017,15 @@ static void __unreserve_and_free_heap(void *ptr, size_t size, int kmflags) } } +static void xnheap_vmopen(struct vm_area_struct *vma) +{ + xnheap_t *heap = vma->vm_private_data; + + spin_lock(&kheapq_lock); + heap->archdep.numaps++; + spin_unlock(&kheapq_lock); +} + static void xnheap_vmclose(struct vm_area_struct *vma) { xnheap_t *heap = vma->vm_private_data; @@ -1037,7 +1046,8 @@ static void xnheap_vmclose(struct vm_area_struct *vma) } static struct vm_operations_struct xnheap_vmops = { - .close = &xnheap_vmclose + .open = &xnheap_vmopen, + .close = &xnheap_vmclose }; static int xnheap_open(struct inode *inode, struct file *file) _______________________________________________ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git