Skip to content

Commit

Permalink
nommu: fix SYSV SHM for NOMMU
Browse files Browse the repository at this point in the history
Commit c4caa77 ("file
->get_unmapped_area() shouldn't duplicate work of get_unmapped_area()")
broke SYSV SHM for NOMMU by taking away the pointer to
shm_get_unmapped_area() from shm_file_operations.

Put it back conditionally on CONFIG_MMU=n.

file->f_ops->get_unmapped_area() is used to find out the base address for a
mapping of a mappable chardev device or mappable memory-based file (such as a
ramfs file).  It needs to be called prior to file->f_ops->mmap() being called.

Signed-off-by: David Howells <[email protected]>
Acked-by: Al Viro <[email protected]>
Cc: Greg Ungerer <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dhowells authored and torvalds committed Jan 16, 2010
1 parent 8ff410d commit ed5e589
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ipc/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ static const struct file_operations shm_file_operations = {
.mmap = shm_mmap,
.fsync = shm_fsync,
.release = shm_release,
#ifndef CONFIG_MMU
.get_unmapped_area = shm_get_unmapped_area,
#endif
};

static const struct file_operations shm_file_operations_huge = {
Expand Down

0 comments on commit ed5e589

Please sign in to comment.