[PATCH] MAP_POPULATE prot 0

From: Hugh Dickins
Date: Mon May 24 2004 - 14:07:57 EST


It seems eccentric to implement MAP_POPULATE only on PROT_NONE mappings:
do_mmap_pgoff is passing down prot, then sys_remap_file_pages verifies
it's not set. I guess that's an oversight from when we realized that
the prot arg to sys_remap_file_pages was misdesigned.

There's another oddity whose heritage is harder for me to understand,
so please let me leave it to you: sys_remap_file_pages is declared as
asmlinkage in mm/fremap.c, but is the one syscall declared without
asmlinkage in include/linux/syscalls.h.

Signed-off-by: Hugh Dickins <hugh@xxxxxxxxxxx>

--- 2.6.7-rc1/mm/mmap.c 2004-05-24 12:17:56.209179464 +0100
+++ linux/mm/mmap.c 2004-05-24 19:33:40.265678752 +0100
@@ -951,7 +951,7 @@ out:
}
if (flags & MAP_POPULATE) {
up_write(&mm->mmap_sem);
- sys_remap_file_pages(addr, len, prot,
+ sys_remap_file_pages(addr, len, 0,
pgoff, flags & MAP_NONBLOCK);
down_write(&mm->mmap_sem);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/