Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ed1c328 authored by KyongHo Cho's avatar KyongHo Cho Committed by Mauro Carvalho Chehab
Browse files

[media] v4l: vb2-memops: use vma slab when vma allocation



The slab for vm_area_struct which is vm_area_cachep is already prepared
for the general use. Instead of kmalloc() for the vma copy for userptr,
allocation from vm_area_cachep is more beneficial.

CC: Hans Verkuil <hans.verkuil@cisco.com>
CC: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarCho KyongHo <pullip.cho@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent cc4e8c3d
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@ struct vm_area_struct *vb2_get_vma(struct vm_area_struct *vma)
{
{
	struct vm_area_struct *vma_copy;
	struct vm_area_struct *vma_copy;


	vma_copy = kmalloc(sizeof(*vma_copy), GFP_KERNEL);
	vma_copy = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
	if (vma_copy == NULL)
	if (vma_copy == NULL)
		return NULL;
		return NULL;


@@ -75,7 +75,7 @@ void vb2_put_vma(struct vm_area_struct *vma)
	if (vma->vm_file)
	if (vma->vm_file)
		fput(vma->vm_file);
		fput(vma->vm_file);


	kfree(vma);
	kmem_cache_free(vm_area_cachep, vma);
}
}
EXPORT_SYMBOL_GPL(vb2_put_vma);
EXPORT_SYMBOL_GPL(vb2_put_vma);