diff options
author | Steven Truelove <steven.truelove@utoronto.ca> | 2012-03-21 19:34:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 20:54:59 -0400 |
commit | 40716e29243de46720e5773797791466c28904ec (patch) | |
tree | 19616ad05cbead73d0643b002a7ced8baa292ee2 /include/linux/hugetlb.h | |
parent | 21a3c273f88c9cbbaf7e14505df0131d95c8f262 (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.h | 6 |
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 | ||
153 | extern const struct file_operations hugetlbfs_file_operations; | 153 | extern const struct file_operations hugetlbfs_file_operations; |
154 | extern const struct vm_operations_struct hugetlb_vm_ops; | 154 | extern const struct vm_operations_struct hugetlb_vm_ops; |
155 | struct file *hugetlb_file_setup(const char *name, size_t size, vm_flags_t acct, | 155 | struct 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 | ||
158 | static inline int is_file_hugepages(struct file *file) | 159 | static 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 |
171 | static inline struct file *hugetlb_file_setup(const char *name, size_t size, | 172 | static inline struct file * |
173 | hugetlb_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); |