#include <linux/vmalloc.h>
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
+#include <linux/syscalls.h>
#include <asm/uaccess.h>
#include <asm/tlb.h>
atomic_t vm_committed_space = ATOMIC_INIT(0);
int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
int sysctl_overcommit_ratio = 50; /* default is 50% */
-
int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT;
+
EXPORT_SYMBOL(sysctl_max_map_count);
+EXPORT_SYMBOL(mem_map);
/*
* Handle all mappings that got truncated by a "truncate()"
goto out_truncate;
do_expand:
- limit = current->rlim[RLIMIT_FSIZE].rlim_cur;
+ limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
if (limit != RLIM_INFINITY && offset > limit)
goto out_sig;
if (offset > inode->i_sb->s_maxbytes)
return -EFBIG;
}
+EXPORT_SYMBOL(vmtruncate);
+
/*
* Return the total memory allocated for this pointer, not
* just what the caller asked for.
return virt_to_page(addr);
}
+unsigned long vmalloc_to_pfn(void *addr)
+{
+ return page_to_pfn(virt_to_page(addr));
+}
+
+
long vread(char *buf, char *addr, unsigned long count)
{
memcpy(buf, addr, count);
tblock->next = current->mm->context.tblock.next;
current->mm->context.tblock.next = tblock;
+ current->mm->total_vm += len >> PAGE_SHIFT;
#ifdef DEBUG
printk("do_mmap:\n");
realalloc -= kobjsize(tblock);
askedalloc -= sizeof(struct mm_tblock_struct);
kfree(tblock);
+ mm->total_vm -= len >> PAGE_SHIFT;
#ifdef DEBUG
show_process_blocks();
void exit_mmap(struct mm_struct * mm)
{
struct mm_tblock_struct *tmp;
+ mm->total_vm = 0;
if (!mm)
return;
return NULL;
}
-int remap_page_range(struct vm_area_struct *vma, unsigned long from,
+int remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
unsigned long to, unsigned long size, pgprot_t prot)
{
return -EPERM;
void swap_unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
{
}
+
+unsigned long arch_get_unmapped_area(struct file *file, unsigned long addr,
+ unsigned long len, unsigned long pgoff, unsigned long flags)
+{
+ return -ENOMEM;
+}
+
+void arch_unmap_area(struct vm_area_struct *area)
+{
+}
+