From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@osdl.org, agl@us.ibm.com
Cc: linux-kernel@vger.kernel.org, dhowells@redhat.com
Subject: [PATCH] NOMMU: Supply get_unmapped_area() to fix NOMMU SYSV SHM
Date: Wed, 21 Mar 2007 17:44:45 +0000 [thread overview]
Message-ID: <20070321174445.23664.91613.stgit@warthog.cambridge.redhat.com> (raw)
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.
next reply other threads:[~2007-03-21 17:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-21 17:44 David Howells [this message]
2007-03-21 18:20 ` Adam Litke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070321174445.23664.91613.stgit@warthog.cambridge.redhat.com \
--to=dhowells@redhat.com \
--cc=agl@us.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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