From d162cf5720fb2623c14a35a4b14981789859d400 Mon Sep 17 00:00:00 2001 From: Sean McNeil Date: Wed, 19 Nov 2008 17:11:13 +0000 Subject: android-tracking.patch Minimal set of kernel changes to support Android operation. Note arch/arm/configs/gta02-android-defconfig --- mm/tiny-shmem.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'mm/tiny-shmem.c') diff --git a/mm/tiny-shmem.c b/mm/tiny-shmem.c index 3e67d575ee6..b00e6fdcc56 100644 --- a/mm/tiny-shmem.c +++ b/mm/tiny-shmem.c @@ -97,6 +97,22 @@ put_memory: } EXPORT_SYMBOL_GPL(shmem_file_setup); +void shmem_set_file(struct vm_area_struct *vma, struct file *file) +{ + if (vma->vm_file) + fput(vma->vm_file); + vma->vm_file = file; + vma->vm_ops = &generic_file_vm_ops; +} + +void shmem_set_file(struct vm_area_struct *vma, struct file *file) +{ + if (vma->vm_file) + fput(vma->vm_file); + vma->vm_file = file; + vma->vm_ops = &generic_file_vm_ops; +} + /** * shmem_zero_setup - setup a shared anonymous mapping * @vma: the vma to be mmapped is prepared by do_mmap_pgoff @@ -110,10 +126,8 @@ int shmem_zero_setup(struct vm_area_struct *vma) if (IS_ERR(file)) return PTR_ERR(file); - if (vma->vm_file) - fput(vma->vm_file); - vma->vm_file = file; - vma->vm_ops = &generic_file_vm_ops; + shmem_set_file(vma, file); + return 0; } -- cgit v1.2.3