#include <linux/mman.h>
#include <linux/mm.h>
+#include <linux/vs_memory.h>
static int mlock_fixup(struct vm_area_struct * vma,
struct vm_area_struct * vma, * next;
int error;
- if (on && !can_do_mlock())
+ if (on && !capable(CAP_IPC_LOCK))
return -EPERM;
len = PAGE_ALIGN(len);
end = start + len;
lock_limit >>= PAGE_SHIFT;
/* check against resource limits */
- if ( (locked <= lock_limit) || capable(CAP_IPC_LOCK))
+ if (locked <= lock_limit)
error = do_mlock(start, len, 1);
out:
up_write(¤t->mm->mmap_sem);
unsigned int def_flags;
struct vm_area_struct * vma;
- if (!can_do_mlock())
+ if (!capable(CAP_IPC_LOCK))
return -EPERM;
def_flags = 0;