-/*
- * This routine is analogous to expand_stack() but instead grows the
- * register backing store (which grows towards higher addresses).
- * Since the register backing store is access sequentially, we
- * disallow growing the RBS by more than a page at a time. Note that
- * the VM_GROWSUP flag can be set on any VM area but that's fine
- * because the total process size is still limited by RLIMIT_STACK and
- * RLIMIT_AS.
- */
-static inline long
-expand_backing_store (struct vm_area_struct *vma, unsigned long address)
-{
- unsigned long grow;
-
- grow = PAGE_SIZE >> PAGE_SHIFT;
- if (address - vma->vm_start > current->rlim[RLIMIT_STACK].rlim_cur
- || (((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) >
- current->rlim[RLIMIT_AS].rlim_cur))
- return -ENOMEM;
- if (!vx_vmpages_avail(vma->vm_mm, grow) ||
- ((vma->vm_flags & VM_LOCKED) &&
- !vx_vmlocked_avail(vma->vm_mm, grow)))
- return -ENOMEM;
- vma->vm_end += PAGE_SIZE;
- // vma->vm_mm->total_vm += grow;
- vx_vmpages_add(vma->vm_mm, grow);
- if (vma->vm_flags & VM_LOCKED)
- // vma->vm_mm->locked_vm += grow;
- vx_vmlocked_add(vma->vm_mm, grow);
- __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file, grow);
- return 0;
-}
-