aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hugetlb.h
diff options
context:
space:
mode:
authorSteven Truelove <steven.truelove@utoronto.ca>2012-03-21 19:34:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 20:54:59 -0400
commit40716e29243de46720e5773797791466c28904ec (patch)
tree19616ad05cbead73d0643b002a7ced8baa292ee2 /include/linux/hugetlb.h
parent21a3c273f88c9cbbaf7e14505df0131d95c8f262 (diff)
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 'include/linux/hugetlb.h')
-rw-r--r--include/linux/hugetlb.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index cf0181738c9e..000837e126e6 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -152,7 +152,8 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
152 152
153extern const struct file_operations hugetlbfs_file_operations; 153extern const struct file_operations hugetlbfs_file_operations;
154extern const struct vm_operations_struct hugetlb_vm_ops; 154extern const struct vm_operations_struct hugetlb_vm_ops;
155struct file *hugetlb_file_setup(const char *name, size_t size, vm_flags_t acct, 155struct file *hugetlb_file_setup(const char *name, unsigned long addr,
156 size_t size, vm_flags_t acct,
156 struct user_struct **user, int creat_flags); 157 struct user_struct **user, int creat_flags);
157 158
158static inline int is_file_hugepages(struct file *file) 159static inline int is_file_hugepages(struct file *file)
@@ -168,7 +169,8 @@ static inline int is_file_hugepages(struct file *file)
168#else /* !CONFIG_HUGETLBFS */ 169#else /* !CONFIG_HUGETLBFS */
169 170
170#define is_file_hugepages(file) 0 171#define is_file_hugepages(file) 0
171static inline struct file *hugetlb_file_setup(const char *name, size_t size, 172static inline struct file *
173hugetlb_file_setup(const char *name, unsigned long addr, size_t size,
172 vm_flags_t acctflag, struct user_struct **user, int creat_flags) 174 vm_flags_t acctflag, struct user_struct **user, int creat_flags)
173{ 175{
174 return ERR_PTR(-ENOSYS); 176 return ERR_PTR(-ENOSYS);