upgrade to linux 2.6.10-1.12_FC2
[linux-2.6.git] / mm / nommu.c
index dd4b66b..1e780d5 100644 (file)
@@ -19,6 +19,7 @@
 #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>
@@ -32,9 +33,10 @@ unsigned long askedalloc, realalloc;
 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()"
@@ -57,7 +59,7 @@ int vmtruncate(struct inode *inode, loff_t offset)
        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)
@@ -74,6 +76,8 @@ out:
        return -EFBIG;
 }
 
+EXPORT_SYMBOL(vmtruncate);
+
 /*
  * Return the total memory allocated for this pointer, not
  * just what the caller asked for.
@@ -140,6 +144,12 @@ struct page * vmalloc_to_page(void *addr)
        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);
@@ -430,6 +440,7 @@ unsigned long do_mmap_pgoff(
 
        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");
@@ -483,6 +494,7 @@ int do_munmap(struct mm_struct * mm, unsigned long addr, size_t len)
        realalloc -= kobjsize(tblock);
        askedalloc -= sizeof(struct mm_tblock_struct);
        kfree(tblock);
+       mm->total_vm -= len >> PAGE_SHIFT;
 
 #ifdef DEBUG
        show_process_blocks();
@@ -495,6 +507,7 @@ int do_munmap(struct mm_struct * mm, unsigned long addr, size_t len)
 void exit_mmap(struct mm_struct * mm)
 {
        struct mm_tblock_struct *tmp;
+       mm->total_vm = 0;
 
        if (!mm)
                return;
@@ -559,7 +572,7 @@ struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr)
        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;
@@ -574,3 +587,14 @@ unsigned long get_unmapped_area(struct file *file, unsigned long addr,
 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)
+{
+}
+