diff options
Diffstat (limited to 'mm/nommu.c')
-rw-r--r-- | mm/nommu.c | 22 |
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, | |||
1193 | EXPORT_SYMBOL(unmap_mapping_range); | 1193 | EXPORT_SYMBOL(unmap_mapping_range); |
1194 | 1194 | ||
1195 | /* | 1195 | /* |
1196 | * ask for an unmapped area at which to create a mapping on a file | ||
1197 | */ | ||
1198 | unsigned 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 | |||
1215 | EXPORT_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. |