Merge branch 'for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[deliverable/linux.git] / fs / proc / task_mmu.c
index b0ae0be4801f821f81c872299c135f55e6fb377c..6f61b7cc32e0e09c39aea2dd31cf64e2bc049060 100644 (file)
@@ -204,6 +204,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
        struct file *file = vma->vm_file;
        int flags = vma->vm_flags;
        unsigned long ino = 0;
+       unsigned long long pgoff = 0;
        dev_t dev = 0;
        int len;
 
@@ -211,6 +212,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
                struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
                dev = inode->i_sb->s_dev;
                ino = inode->i_ino;
+               pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
        }
 
        seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
@@ -220,7 +222,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
                        flags & VM_WRITE ? 'w' : '-',
                        flags & VM_EXEC ? 'x' : '-',
                        flags & VM_MAYSHARE ? 's' : 'p',
-                       ((loff_t)vma->vm_pgoff) << PAGE_SHIFT,
+                       pgoff,
                        MAJOR(dev), MINOR(dev), ino, &len);
 
        /*
@@ -663,6 +665,10 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
                goto out_task;
 
        ret = 0;
+
+       if (!count)
+               goto out_task;
+
        mm = get_task_mm(task);
        if (!mm)
                goto out_task;
This page took 0.048861 seconds and 5 git commands to generate.