aboutsummaryrefslogtreecommitdiffstats
path: root/mm/nommu.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2007-03-22 04:11:23 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-22 22:39:05 -0400
commitd56e03cd275486eb8141116a7af2df7457cb0115 (patch)
treeadc85d1c9b342a9dd68451780cd555c8fc483dbc /mm/nommu.c
parent8da38d7bac802ed2a09a79aaae9961c806a1847c (diff)
[PATCH] NOMMU: supply get_unmapped_area() to fix NOMMU SYSV SHM
Supply a get_unmapped_area() to fix NOMMU SYSV SHM support. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/nommu.c')
-rw-r--r--mm/nommu.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/mm/nommu.c b/mm/nommu.c
index 23fb033e596d..ba6df4d29979 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1193,6 +1193,28 @@ void unmap_mapping_range(struct address_space *mapping,
1193EXPORT_SYMBOL(unmap_mapping_range); 1193EXPORT_SYMBOL(unmap_mapping_range);
1194 1194
1195/* 1195/*
1196 * ask for an unmapped area at which to create a mapping on a file
1197 */
1198unsigned long get_unmapped_area(struct file *file, unsigned long addr,
1199 unsigned long len, unsigned long pgoff,
1200 unsigned long flags)
1201{
1202 unsigned long (*get_area)(struct file *, unsigned long, unsigned long,
1203 unsigned long, unsigned long);
1204
1205 get_area = current->mm->get_unmapped_area;
1206 if (file && file->f_op && file->f_op->get_unmapped_area)
1207 get_area = file->f_op->get_unmapped_area;
1208
1209 if (!get_area)
1210 return -ENOSYS;
1211
1212 return get_area(file, addr, len, pgoff, flags);
1213}
1214
1215EXPORT_SYMBOL(get_unmapped_area);
1216
1217/*
1196 * Check that a process has enough memory to allocate a new virtual 1218 * Check that a process has enough memory to allocate a new virtual
1197 * mapping. 0 means there is enough memory for the allocation to 1219 * mapping. 0 means there is enough memory for the allocation to
1198 * succeed and -ENOMEM implies there is not. 1220 * succeed and -ENOMEM implies there is not.