From: "Wu, Bryan" <bryan.wu@analog.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Pekka Enberg <penberg@cs.helsinki.fi>,
linux-kernel@vger.kernel.org
Subject: [PATCH -mm] Revoke core code: fix nommu arch compiling error bug
Date: Mon, 26 Mar 2007 18:23:57 +0800 [thread overview]
Message-ID: <1174904637.32691.86.camel@roc-desktop> (raw)
Hi folks,
As struct mm_struct vm_mm is hidden in struct vm_area_struct in NOMMU
arch, this is a fixing method when compiling failure on blackfin arch.
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
---
fs/revoke.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
Index: linux-2.6/fs/revoke.c
===================================================================
--- linux-2.6.orig/fs/revoke.c
+++ linux-2.6/fs/revoke.c
@@ -207,13 +207,21 @@
/*
* LOCKING: spin_lock(&mapping->i_mmap_lock)
*/
-static int revoke_mm(struct mm_struct *mm, struct address_space *mapping,
+static int revoke_mm(struct vm_area_struct *vma, struct address_space *mapping,
struct file *to_exclude)
{
- struct vm_area_struct *vma;
+#ifdef CONFIG_MMU
+ struct mm_struct *mm = vma->vm_mm;
+#else
+ struct mm_struct *mm = 0;
+#endif
+ struct vm_area_struct *_vma;
struct zap_details details;
int err = 0;
+ if (!mm)
+ return -ENOENT;
+
details.i_mmap_lock = &mapping->i_mmap_lock;
/*
@@ -224,11 +232,11 @@
err = -EAGAIN;
goto out;
}
- for (vma = mm->mmap; vma != NULL; vma = vma->vm_next) {
- if (!need_revoke(vma, to_exclude))
+ for (_vma = mm->mmap; _vma != NULL; _vma = _vma->vm_next) {
+ if (!need_revoke(_vma, to_exclude))
continue;
- err = revoke_vma(vma, &details);
+ err = revoke_vma(_vma, &details);
if (err)
break;
}
@@ -254,7 +262,7 @@
if (likely(!need_revoke(vma, to_exclude)))
continue;
- err = revoke_mm(vma->vm_mm, mapping, to_exclude);
+ err = revoke_mm(vma, mapping, to_exclude);
if (err == -EAGAIN) {
try_again = 1;
continue;
@@ -284,7 +292,7 @@
if (likely(!need_revoke(vma, to_exclude)))
continue;
- err = revoke_mm(vma->vm_mm, mapping, to_exclude);
+ err = revoke_mm(vma, mapping, to_exclude);
if (err == -EAGAIN) {
try_again = 1;
continue;
_
Thanks,
-Bryan Wu
next reply other threads:[~2007-03-26 10:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-26 10:23 Wu, Bryan [this message]
2007-03-26 10:37 ` [PATCH -mm] Revoke core code: fix nommu arch compiling error bug Pekka J Enberg
2007-03-26 10:41 ` Andrew Morton
2007-03-26 11:25 ` David Howells
2007-03-26 11:30 ` Pekka J Enberg
2007-03-26 11:44 ` David Howells
2007-03-26 11:55 ` Pekka J Enberg
2007-03-26 12:22 ` David Howells
2007-03-26 12:37 ` Pekka J Enberg
2007-03-26 13:24 ` David Howells
2007-03-26 20:21 ` Mike Frysinger
2007-03-27 3:29 ` Wu, Bryan
2007-03-27 6:57 ` Pekka J Enberg
2007-03-27 7:20 ` Mike Frysinger
2007-03-27 10:05 ` David Howells
2007-03-27 17:00 ` Mike Frysinger
2007-03-27 19:06 ` David Howells
2007-03-26 13:03 ` Alan Cox
2007-03-26 11:50 ` Andrew Morton
2007-03-26 11:58 ` David Howells
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=1174904637.32691.86.camel@roc-desktop \
--to=bryan.wu@analog.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
/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