#ifdef CONFIG_MMU
-void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
-{
- struct mm_struct *mm = current->mm;
- long diff = (long)(pages - bprm->vma_pages);
-
- if (!mm || !diff)
- return;
-
- bprm->vma_pages = pages;
-
- down_write(&mm->mmap_sem);
- mm->total_vm += diff;
- up_write(&mm->mmap_sem);
-}
-
-struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
+static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
int write)
{
struct page *page;
unsigned long size = bprm->vma->vm_end - bprm->vma->vm_start;
struct rlimit *rlim;
- acct_arg_size(bprm, size / PAGE_SIZE);
-
/*
* We've historically supported up to 32 pages (ARG_MAX)
* of argument strings even with small stacks
#else
-void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
-{
-}
-
-struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
+static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
int write)
{
struct page *page;
/*
* Release all of the old mmap stuff
*/
- acct_arg_size(bprm, 0);
retval = exec_mmap(bprm->mm);
if (retval)
goto out;
return retval;
out:
- if (bprm->mm) {
- acct_arg_size(bprm, 0);
- mmput(bprm->mm);
- }
+ if (bprm->mm)
+ mmput (bprm->mm);
out_file:
if (bprm->file) {