]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/mm.h
Detach sched.h from mm.h
[net-next-2.6.git] / include / linux / mm.h
index 4670ebd1f6229222bbd6df7343362b14f661603e..e4183c6c7de3dca209ed8f99eb852719e3f31bfb 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _LINUX_MM_H
 #define _LINUX_MM_H
 
-#include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/capability.h>
 
@@ -20,6 +19,7 @@
 
 struct mempolicy;
 struct anon_vma;
+struct user_struct;
 
 #ifndef CONFIG_DISCONTIGMEM          /* Don't use mapnrs, do it properly */
 extern unsigned long max_mapnr;
@@ -717,14 +717,7 @@ extern unsigned long shmem_get_unmapped_area(struct file *file,
                                             unsigned long flags);
 #endif
 
-static inline int can_do_mlock(void)
-{
-       if (capable(CAP_IPC_LOCK))
-               return 1;
-       if (current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur != 0)
-               return 1;
-       return 0;
-}
+extern int can_do_mlock(void);
 extern int user_shm_lock(size_t, struct user_struct *);
 extern void user_shm_unlock(size_t, struct user_struct *);