Skip to content

Commit

Permalink
NOMMU: Fix SYSV IPC SHM
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Nick Piggin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dhowells authored and Linus Torvalds committed Jul 31, 2007
1 parent 6a30235 commit 2e92a3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/ramfs/file-nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 2 additions & 0 deletions ipc/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2e92a3b

Please sign in to comment.