mm: use dedicated helper to access rlimit value
Subsystems (2)
[email protected]
maintainerPATCH 57/115 mm: use dedicated helper to access rlimit value
From: Krzysztof Opasiak <[email protected]>
Subject: mm: use dedicated helper to access rlimit value
Use rlimit() helper instead of manually writing whole chain from current task to rlim_cur.
Signed-off-by Krzysztof Opasiak <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/mmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
mm/mmap.c renamed from mm/mmap.c~mm-use-dedicated-helper-to-access-rlimit-value +2 -3
@@ -2177,7 +2177,6 @@ static int acct_stack_growth(struct vm_a unsigned long size, unsigned long grow) {struct mm_struct *mm = vma->vm_mm; -struct rlimit *rlim = current->signal->rlim;unsigned long new_start;/* address space limit tests */
@@ -2185,7 +2184,7 @@ static int acct_stack_growth(struct vm_areturn -ENOMEM ;/* Stack limit test */ -if (size >READ_ONCE (rlim[RLIMIT_STACK ].rlim_cur)) +if (size >rlimit (RLIMIT_STACK ))return -ENOMEM ;/* mlock limit tests */
@@ -2193,7 +2192,7 @@ static int acct_stack_growth(struct vm_aunsigned long locked;unsigned long limit; locked = mm->locked_vm + grow; - limit =READ_ONCE (rlim[RLIMIT_MEMLOCK ].rlim_cur); + limit =rlimit (RLIMIT_MEMLOCK ); limit >>=PAGE_SHIFT ;if (locked > limit && !capable (CAP_IPC_LOCK ))return -ENOMEM ;
_