* [PATCH] NOMMU: Fix SYSV IPC SHM
@ 2007-07-26 19:06 David Howells
0 siblings, 0 replies; only message in thread
From: David Howells @ 2007-07-26 19:06 UTC (permalink / raw)
To: torvalds, akpm, npiggin; +Cc: linux-kernel, uclinux-dev, dhowells
From: David Howells <dhowells@redhat.com>
Fix the SYSV IPC SHM to work with the changes applied by the new fault handler
patches when CONFIG_MMU=n.
Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/ramfs/file-nommu.c | 7 ++++++-
ipc/shm.c | 2 ++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index cad2b7a..237fe8b 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -295,5 +295,10 @@ unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
*/
int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma)
{
- return vma->vm_flags & VM_SHARED ? 0 : -ENOSYS;
+ if (!(vma->vm_flags & VM_SHARED))
+ return -ENOSYS;
+
+ file_accessed(file);
+ vma->vm_ops = &generic_file_vm_ops;
+ return 0;
}
diff --git a/ipc/shm.c b/ipc/shm.c
index d0259e3..d88ac5a 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -268,7 +268,9 @@ static int shm_mmap(struct file * file, struct vm_area_struct * vma)
if (ret != 0)
return ret;
sfd->vm_ops = vma->vm_ops;
+#ifdef CONFIG_MMU
BUG_ON(!sfd->vm_ops->fault);
+#endif
vma->vm_ops = &shm_vm_ops;
shm_open(vma);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-07-26 19:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-26 19:06 [PATCH] NOMMU: Fix SYSV IPC SHM David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®