diff options
author | John Stultz <john.stultz@linaro.org> | 2011-12-15 18:51:04 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2012-02-14 11:25:59 -0800 |
commit | d260ada6528933d87724e2b9dba5de0c627e29a3 (patch) | |
tree | 93ff76ec9a8471524c04d346d46c9e166721c08c /drivers | |
parent | 84b436d537be985c9ecaf1a96151085a3ba120aa (diff) |
ashmem: Add shmem_set_file to mm/shmem.c
NOT FOR STAGING
This patch re-adds the original shmem_set_file to mm/shmem.c
and converts ashmem.c back to using it.
CC: Brian Swetland <swetland@google.com>
CC: Colin Cross <ccross@android.com>
CC: Arve Hjønnevåg <arve@android.com>
CC: Dima Zavin <dima@android.com>
CC: Robert Love <rlove@google.com>
CC: Greg KH <greg@kroah.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/android/ashmem.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index 99052bfd3a2..f5212a1ac4a 100644 --- a/drivers/staging/android/ashmem.c +++ b/drivers/staging/android/ashmem.c @@ -314,21 +314,13 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma) } get_file(asma->file); - /* - * XXX - Reworked to use shmem_zero_setup() instead of - * shmem_set_file while we're in staging. -jstultz - */ - if (vma->vm_flags & VM_SHARED) { - ret = shmem_zero_setup(vma); - if (ret) { - fput(asma->file); - goto out; - } + if (vma->vm_flags & VM_SHARED) + shmem_set_file(vma, asma->file); + else { + if (vma->vm_file) + fput(vma->vm_file); + vma->vm_file = asma->file; } - - if (vma->vm_file) - fput(vma->vm_file); - vma->vm_file = asma->file; vma->vm_flags |= VM_CAN_NONLINEAR; out: |