summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorSteven Truelove <steven.truelove@utoronto.ca>2012-03-21 16:34:14 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 17:54:59 -0700
commit40716e29243de46720e5773797791466c28904ec (patch)
tree19616ad05cbead73d0643b002a7ced8baa292ee2 /ipc
parent21a3c273f88c9cbbaf7e14505df0131d95c8f262 (diff)
downloadblackbird-op-linux-40716e29243de46720e5773797791466c28904ec.tar.gz
blackbird-op-linux-40716e29243de46720e5773797791466c28904ec.zip
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>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index b76be5bda6c2..406c5b208193 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -482,7 +482,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
/* hugetlb_file_setup applies strict accounting */
if (shmflg & SHM_NORESERVE)
acctflag = VM_NORESERVE;
- file = hugetlb_file_setup(name, size, acctflag,
+ file = hugetlb_file_setup(name, 0, size, acctflag,
&shp->mlock_user, HUGETLB_SHMFS_INODE);
} else {
/*
OpenPOWER on IntegriCloud