diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2012-02-12 22:58:52 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2012-02-13 18:45:39 -0500 |
commit | 191c542442fdf53cc3c496c00be13367fd9cd42d (patch) | |
tree | 4aef9e33a1d99e6530b704243efbe373bb314d61 /include/linux/security.h | |
parent | bbd36568594d091e682a1975ef4ee41d808de0bc (diff) |
mm: collapse security_vm_enough_memory() variants into a single function
Collapse security_vm_enough_memory() variants into a single function.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'include/linux/security.h')
-rw-r--r-- | include/linux/security.h | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index 8325eddd9ee4..2fefad6d27a0 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1679,9 +1679,7 @@ int security_quotactl(int cmds, int type, int id, struct super_block *sb); | |||
1679 | int security_quota_on(struct dentry *dentry); | 1679 | int security_quota_on(struct dentry *dentry); |
1680 | int security_syslog(int type); | 1680 | int security_syslog(int type); |
1681 | int security_settime(const struct timespec *ts, const struct timezone *tz); | 1681 | int security_settime(const struct timespec *ts, const struct timezone *tz); |
1682 | int security_vm_enough_memory(long pages); | ||
1683 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); | 1682 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); |
1684 | int security_vm_enough_memory_kern(long pages); | ||
1685 | int security_bprm_set_creds(struct linux_binprm *bprm); | 1683 | int security_bprm_set_creds(struct linux_binprm *bprm); |
1686 | int security_bprm_check(struct linux_binprm *bprm); | 1684 | int security_bprm_check(struct linux_binprm *bprm); |
1687 | void security_bprm_committing_creds(struct linux_binprm *bprm); | 1685 | void security_bprm_committing_creds(struct linux_binprm *bprm); |
@@ -1902,25 +1900,11 @@ static inline int security_settime(const struct timespec *ts, | |||
1902 | return cap_settime(ts, tz); | 1900 | return cap_settime(ts, tz); |
1903 | } | 1901 | } |
1904 | 1902 | ||
1905 | static inline int security_vm_enough_memory(long pages) | ||
1906 | { | ||
1907 | WARN_ON(current->mm == NULL); | ||
1908 | return cap_vm_enough_memory(current->mm, pages); | ||
1909 | } | ||
1910 | |||
1911 | static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) | 1903 | static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) |
1912 | { | 1904 | { |
1913 | WARN_ON(mm == NULL); | ||
1914 | return cap_vm_enough_memory(mm, pages); | 1905 | return cap_vm_enough_memory(mm, pages); |
1915 | } | 1906 | } |
1916 | 1907 | ||
1917 | static inline int security_vm_enough_memory_kern(long pages) | ||
1918 | { | ||
1919 | /* If current->mm is a kernel thread then we will pass NULL, | ||
1920 | for this specific case that is fine */ | ||
1921 | return cap_vm_enough_memory(current->mm, pages); | ||
1922 | } | ||
1923 | |||
1924 | static inline int security_bprm_set_creds(struct linux_binprm *bprm) | 1908 | static inline int security_bprm_set_creds(struct linux_binprm *bprm) |
1925 | { | 1909 | { |
1926 | return cap_bprm_set_creds(bprm); | 1910 | return cap_bprm_set_creds(bprm); |