public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mm] Revoke core code: fix nommu arch compiling error bug
@ 2007-03-26 10:23 Wu, Bryan
  2007-03-26 10:37 ` Pekka J Enberg
  2007-03-26 10:41 ` Andrew Morton
  0 siblings, 2 replies; 20+ messages in thread
From: Wu, Bryan @ 2007-03-26 10:23 UTC (permalink / raw)
  To: Andrew Morton, Pekka Enberg, linux-kernel

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2007-03-27 19:07 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-26 10:23 [PATCH -mm] Revoke core code: fix nommu arch compiling error bug Wu, Bryan
2007-03-26 10:37 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox