]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
hugetlbfs: fix alignment of huge page requests
authorSteven Truelove <steven.truelove@utoronto.ca>
Wed, 21 Mar 2012 23:34:14 +0000 (16:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 22 Mar 2012 00:54:59 +0000 (17:54 -0700)
commit40716e29243de46720e5773797791466c28904ec
tree19616ad05cbead73d0643b002a7ced8baa292ee2
parent21a3c273f88c9cbbaf7e14505df0131d95c8f262
hugetlbfs: fix alignment of huge page requests

When calling shmget() with SHM_HUGETLB, shmget aligns the request size to
PAGE_SIZE, but this is not sufficient.

Modify hugetlb_file_setup() to align requests to the huge page size, and
to accept an address argument so that all alignment checks can be
performed in hugetlb_file_setup(), rather than in its callers.  Change
newseg() and mmap_pgoff() to match the new prototype and eliminate a now
redundant alignment check.

[akpm@linux-foundation.org: fix build]
Signed-off-by: Steven Truelove <steven.truelove@utoronto.ca>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/hugetlbfs/inode.c
include/linux/hugetlb.h
ipc/shm.c
mm/mmap.c