1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-26 18:43:33 -05:00
linux/fs
Zhang, Yanmin b6174df5ee [PATCH] mmap zero-length hugetlb file with PROT_NONE to protect a hugetlb virtual area
Sometimes, applications need below call to be successful although
"/mnt/hugepages/file1" doesn't exist.

fd = open("/mnt/hugepages/file1", O_CREAT|O_RDWR, 0755);
*addr = mmap(NULL, 0x1024*1024*256, PROT_NONE, 0, fd, 0);

As for regular pages (or files), above call does work, but as for huge
pages, above call would fail because hugetlbfs_file_mmap would fail if
(!(vma->vm_flags & VM_WRITE) && len > inode->i_size).

This capability on huge page is useful on ia64 when the process wants to
protect one area on region 4, so other threads couldn't read/write this
area.  A famous JVM (Java Virtual Machine) implementation on IA64 needs the
capability.

Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Hugh Dickins <hugh@veritas.com>
[ Expand-on-mmap semantics again... this time matching normal fs's. wli ]
Acked-by: William Lee Irwin III <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 13:24:21 -07:00
..
9p
adfs
affs
afs
autofs
autofs4
befs
bfs
cifs
coda
configfs
cramfs
debugfs
devpts
efs
exportfs
ext2 [PATCH] lockdep: annotate the quota code 2006-07-03 15:27:08 -07:00
ext3 [PATCH] lockdep: annotate the quota code 2006-07-03 15:27:08 -07:00
fat
freevxfs
fuse
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs [PATCH] mmap zero-length hugetlb file with PROT_NONE to protect a hugetlb virtual area 2006-07-10 13:24:21 -07:00
isofs
jbd
jffs
jffs2 Merge git://git.infradead.org/mtd-2.6 2006-07-03 21:29:08 -07:00
jfs
lockd NLM,NFSv4: Wait on local locks before we put RPC calls on the wire 2006-07-05 13:13:18 -04:00
minix
msdos
ncpfs
nfs Merge branch 'locks' 2006-07-05 13:19:25 -04:00
nfs_common
nfsd
nls
ntfs [PATCH] lockdep: annotate NTFS locking rules 2006-07-03 15:27:08 -07:00
ocfs2
openpromfs
partitions [PATCH] partitions: let partitions inherit policy from disk 2006-07-10 13:24:14 -07:00
proc [PATCH] uclinux: fix proc_task()/get_proc-task() naming 2006-07-03 22:37:13 -07:00
qnx4
ramfs
reiserfs [PATCH] reiserfs: fix journaling issue regarding fsync() 2006-07-10 13:24:13 -07:00
romfs
smbfs
sysfs
sysv
udf
ufs [PATCH] lockdep: annotate the quota code 2006-07-03 15:27:08 -07:00
vfat
xfs
aio.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c [PATCH] binfmt_elf: fix checks for bad address 2006-07-03 15:26:59 -07:00
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio.c
block_dev.c [PATCH] lockdep: annotate blkdev nesting 2006-07-03 15:27:10 -07:00
buffer.c
char_dev.c
compat.c
compat_ioctl.c
dcache.c [PATCH] lockdep: annotate dcache 2006-07-03 15:27:06 -07:00
dcookies.c
direct-io.c [PATCH] lockdep: annotate direct io 2006-07-03 15:27:06 -07:00
dnotify.c
dquot.c
drop_caches.c
eventpoll.c [PATCH] sched: cleanup, remove task_t, convert to struct task_struct 2006-07-03 15:27:11 -07:00
exec.c
fcntl.c
fifo.c
file.c
file_table.c
filesystems.c
fs-writeback.c
inode.c
inotify.c
inotify_user.c
ioctl.c
ioprio.c
Kconfig
Kconfig.binfmt
libfs.c
locks.c VFS: Add support for the FL_ACCESS flag to flock_lock_file() 2006-07-05 13:13:18 -04:00
Makefile
mbcache.c
mpage.c
namei.c [PATCH] lockdep: annotate i_mutex 2006-07-03 15:27:06 -07:00
namespace.c
nfsctl.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
quota.c
quota_v1.c
quota_v2.c
read_write.c [PATCH] fs/read_write.c: EXPORT_UNUSED_SYMBOL 2006-07-10 13:24:18 -07:00
readdir.c
select.c
seq_file.c
splice.c
stat.c
super.c [PATCH] lockdep: annotate sb ->s_umount 2006-07-03 15:27:09 -07:00
sync.c
xattr.c
xattr_acl.c