Commit 7f43add4 authored by Wang Xiaoqiang's avatar Wang Xiaoqiang Committed by Linus Torvalds

mm/mlock.c: change can_do_mlock return value type to boolean

Since can_do_mlock only return 1 or 0, so make it boolean.

No functional change.

[akpm@linux-foundation.org: update declaration in mm.h]
Signed-off-by: 's avatarWang Xiaoqiang <wangxq10@lzu.edu.cn>
Signed-off-by: 's avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 61e16557
......@@ -1100,7 +1100,7 @@ static inline bool shmem_mapping(struct address_space *mapping)
}
#endif
extern int can_do_mlock(void);
extern bool can_do_mlock(void);
extern int user_shm_lock(size_t, struct user_struct *);
extern void user_shm_unlock(size_t, struct user_struct *);
......
......@@ -24,13 +24,13 @@
#include "internal.h"
int can_do_mlock(void)
bool can_do_mlock(void)
{
if (rlimit(RLIMIT_MEMLOCK) != 0)
return 1;
return true;
if (capable(CAP_IPC_LOCK))
return 1;
return 0;
return true;
return false;
}
EXPORT_SYMBOL(can_do_mlock);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment