* [PATCH] NOMMU: Supply get_unmapped_area() to fix NOMMU SYSV SHM
@ 2007-03-21 17:44 David Howells
2007-03-21 18:20 ` Adam Litke
0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2007-03-21 17:44 UTC (permalink / raw)
To: torvalds, akpm, agl; +Cc: linux-kernel, dhowells
From: David Howells <dhowells@redhat.com>
Supply a get_unmapped_area() to fix NOMMU SYSV SHM support.
Signed-Off-By: David Howells <dhowells@redhat.com>
---
mm/nommu.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/mm/nommu.c b/mm/nommu.c
index 23fb033..ba6df4d 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1193,6 +1193,28 @@ void unmap_mapping_range(struct address_space *mapping,
EXPORT_SYMBOL(unmap_mapping_range);
/*
+ * ask for an unmapped area at which to create a mapping on a file
+ */
+unsigned long get_unmapped_area(struct file *file, unsigned long addr,
+ unsigned long len, unsigned long pgoff,
+ unsigned long flags)
+{
+ unsigned long (*get_area)(struct file *, unsigned long, unsigned long,
+ unsigned long, unsigned long);
+
+ get_area = current->mm->get_unmapped_area;
+ if (file && file->f_op && file->f_op->get_unmapped_area)
+ get_area = file->f_op->get_unmapped_area;
+
+ if (!get_area)
+ return -ENOSYS;
+
+ return get_area(file, addr, len, pgoff, flags);
+}
+
+EXPORT_SYMBOL(get_unmapped_area);
+
+/*
* Check that a process has enough memory to allocate a new virtual
* mapping. 0 means there is enough memory for the allocation to
* succeed and -ENOMEM implies there is not.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] NOMMU: Supply get_unmapped_area() to fix NOMMU SYSV SHM
2007-03-21 17:44 [PATCH] NOMMU: Supply get_unmapped_area() to fix NOMMU SYSV SHM David Howells
@ 2007-03-21 18:20 ` Adam Litke
0 siblings, 0 replies; 2+ messages in thread
From: Adam Litke @ 2007-03-21 18:20 UTC (permalink / raw)
To: David Howells; +Cc: torvalds, akpm, linux-kernel
On Wed, 2007-03-21 at 17:44 +0000, David Howells wrote:
> From: David Howells <dhowells@redhat.com>
>
> Supply a get_unmapped_area() to fix NOMMU SYSV SHM support.
>
> Signed-Off-By: David Howells <dhowells@redhat.com>
Hmm, yes... So it would seem my fix for the shm stacked files stuff was
not quite complete.
Acked-by: Adam Litke <agl@us.ibm.com>
--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-21 18:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-21 17:44 [PATCH] NOMMU: Supply get_unmapped_area() to fix NOMMU SYSV SHM David Howells
2007-03-21 18:20 ` Adam Litke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome