aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorJohn Stultz2011-12-15 20:51:04 -0600
committerArve Hjønnevåg2013-02-19 17:49:11 -0600
commitc2cf9d1f52e9d81b3f33a29f42ef193ea8f8bed8 (patch)
tree280e8da5517c09dd577d93539bf6785c77104e70 /mm
parent46b56700c9cb621487e73870c615062b33db33e7 (diff)
downloadkernel-video-c2cf9d1f52e9d81b3f33a29f42ef193ea8f8bed8.tar.gz
kernel-video-c2cf9d1f52e9d81b3f33a29f42ef193ea8f8bed8.tar.xz
kernel-video-c2cf9d1f52e9d81b3f33a29f42ef193ea8f8bed8.zip
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 'mm')
-rw-r--r--mm/shmem.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 5dd56f6efdb..5cd37f43d3a 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2929,6 +2929,14 @@ put_memory:
2929} 2929}
2930EXPORT_SYMBOL_GPL(shmem_file_setup); 2930EXPORT_SYMBOL_GPL(shmem_file_setup);
2931 2931
2932void shmem_set_file(struct vm_area_struct *vma, struct file *file)
2933{
2934 if (vma->vm_file)
2935 fput(vma->vm_file);
2936 vma->vm_file = file;
2937 vma->vm_ops = &shmem_vm_ops;
2938}
2939
2932/** 2940/**
2933 * shmem_zero_setup - setup a shared anonymous mapping 2941 * shmem_zero_setup - setup a shared anonymous mapping
2934 * @vma: the vma to be mmapped is prepared by do_mmap_pgoff 2942 * @vma: the vma to be mmapped is prepared by do_mmap_pgoff
@@ -2942,10 +2950,7 @@ int shmem_zero_setup(struct vm_area_struct *vma)
2942 if (IS_ERR(file)) 2950 if (IS_ERR(file))
2943 return PTR_ERR(file); 2951 return PTR_ERR(file);
2944 2952
2945 if (vma->vm_file) 2953 shmem_set_file(vma, file);
2946 fput(vma->vm_file);
2947 vma->vm_file = file;
2948 vma->vm_ops = &shmem_vm_ops;
2949 return 0; 2954 return 0;
2950} 2955}
2951 2956