diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hugetlb.h | 8 | ||||
-rw-r--r-- | include/linux/shm.h | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index a60995afe334..3f3e7a648da3 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #ifdef CONFIG_HUGETLB_PAGE | 4 | #ifdef CONFIG_HUGETLB_PAGE |
5 | 5 | ||
6 | #include <linux/mempolicy.h> | 6 | #include <linux/mempolicy.h> |
7 | #include <linux/shm.h> | ||
7 | #include <asm/tlbflush.h> | 8 | #include <asm/tlbflush.h> |
8 | 9 | ||
9 | struct ctl_table; | 10 | struct ctl_table; |
@@ -168,7 +169,12 @@ void hugetlb_put_quota(struct address_space *mapping); | |||
168 | 169 | ||
169 | static inline int is_file_hugepages(struct file *file) | 170 | static inline int is_file_hugepages(struct file *file) |
170 | { | 171 | { |
171 | return file->f_op == &hugetlbfs_file_operations; | 172 | if (file->f_op == &hugetlbfs_file_operations) |
173 | return 1; | ||
174 | if (is_file_shm_hugepages(file)) | ||
175 | return 1; | ||
176 | |||
177 | return 0; | ||
172 | } | 178 | } |
173 | 179 | ||
174 | static inline void set_file_hugepages(struct file *file) | 180 | static inline void set_file_hugepages(struct file *file) |
diff --git a/include/linux/shm.h b/include/linux/shm.h index a2c896ad0bef..ad2e3af65997 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h | |||
@@ -96,12 +96,17 @@ struct shmid_kernel /* private to the kernel */ | |||
96 | 96 | ||
97 | #ifdef CONFIG_SYSVIPC | 97 | #ifdef CONFIG_SYSVIPC |
98 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); | 98 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); |
99 | extern int is_file_shm_hugepages(struct file *file); | ||
99 | #else | 100 | #else |
100 | static inline long do_shmat(int shmid, char __user *shmaddr, | 101 | static inline long do_shmat(int shmid, char __user *shmaddr, |
101 | int shmflg, unsigned long *addr) | 102 | int shmflg, unsigned long *addr) |
102 | { | 103 | { |
103 | return -ENOSYS; | 104 | return -ENOSYS; |
104 | } | 105 | } |
106 | static inline int is_file_shm_hugepages(struct file *file) | ||
107 | { | ||
108 | return 0; | ||
109 | } | ||
105 | #endif | 110 | #endif |
106 | 111 | ||
107 | #endif /* __KERNEL__ */ | 112 | #endif /* __KERNEL__ */ |