/* Return true if the calling process may expand its vm space by the passed number of pages  */
int may_expand_vm(struct mm_struct *mm, unsigned long npages)
/* Return true if the calling process may expand its vm space by the passed number of pages  */
int may_expand_vm(struct mm_struct *mm, unsigned long npages)
{
	unsigned long cur = mm->total_vm;
	unsigned long lim;
	lim = current->signal->rlim[RLIMIT_AS].rlim_cur >> PAGE_SHIFT;
	if (cur + npages > lim)
		return 0;
	return 1;
}