diff options
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 4670ebd1f622..e4183c6c7de3 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_MM_H | 1 | #ifndef _LINUX_MM_H |
2 | #define _LINUX_MM_H | 2 | #define _LINUX_MM_H |
3 | 3 | ||
4 | #include <linux/sched.h> | ||
5 | #include <linux/errno.h> | 4 | #include <linux/errno.h> |
6 | #include <linux/capability.h> | 5 | #include <linux/capability.h> |
7 | 6 | ||
@@ -20,6 +19,7 @@ | |||
20 | 19 | ||
21 | struct mempolicy; | 20 | struct mempolicy; |
22 | struct anon_vma; | 21 | struct anon_vma; |
22 | struct user_struct; | ||
23 | 23 | ||
24 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ | 24 | #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ |
25 | extern unsigned long max_mapnr; | 25 | extern unsigned long max_mapnr; |
@@ -717,14 +717,7 @@ extern unsigned long shmem_get_unmapped_area(struct file *file, | |||
717 | unsigned long flags); | 717 | unsigned long flags); |
718 | #endif | 718 | #endif |
719 | 719 | ||
720 | static inline int can_do_mlock(void) | 720 | extern int can_do_mlock(void); |
721 | { | ||
722 | if (capable(CAP_IPC_LOCK)) | ||
723 | return 1; | ||
724 | if (current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur != 0) | ||
725 | return 1; | ||
726 | return 0; | ||
727 | } | ||
728 | extern int user_shm_lock(size_t, struct user_struct *); | 721 | extern int user_shm_lock(size_t, struct user_struct *); |
729 | extern void user_shm_unlock(size_t, struct user_struct *); | 722 | extern void user_shm_unlock(size_t, struct user_struct *); |
730 | 723 | ||