[PATCH] task_mmu small fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




These are the small fixes done in recent Eric W Biederman's patches.
1. Now seqfile private is separate private struct, not task struct.
2. priv->tail_vma should not be reset based on current file position,
   since once it become NULL, reseeking will not output gate vma;
   so use separate return variable tail_vma.

Signed-Off-by: Prasanna Meda



--- a/fs/proc/task_mmu.c	2006-04-21 19:09:56.000000000 +0530
+++ b/fs/proc/task_mmu.c	2006-04-21 19:22:19.000000000 +0530
@@ -124,7 +124,8 @@ struct mem_size_stats
 
 static int show_map_internal(struct seq_file *m, void *v, struct mem_size_stats *mss)
 {
-	struct task_struct *task = m->private;
+	struct proc_maps_private *priv = m->private;
+	struct task_struct *task = priv->task;
 	struct vm_area_struct *vma = v;
 	struct mm_struct *mm = vma->vm_mm;
 	struct file *file = vma->vm_file;
@@ -302,7 +303,7 @@ static void *m_start(struct seq_file *m,
 	struct proc_maps_private *priv = m->private;
 	unsigned long last_addr = m->version;
 	struct mm_struct *mm;
-	struct vm_area_struct *vma;
+	struct vm_area_struct *vma, *tail_vma = NULL;
 	loff_t l = *pos;
 
 	/* Clear the per syscall fields in priv */
@@ -327,7 +328,7 @@ static void *m_start(struct seq_file *m,
 	if (!mm)
 		return NULL;
 
-	priv->tail_vma = get_gate_vma(priv->task);
+	priv->tail_vma = tail_vma = get_gate_vma(priv->task);
 	down_read(&mm->mmap_sem);
 
 	/* Start with last addr hint */
@@ -349,17 +350,17 @@ static void *m_start(struct seq_file *m,
 	}
 
 	if (l != mm->map_count)
-		priv->tail_vma = NULL; /* After gate vma */
+		tail_vma = NULL; /* After gate vma */
 
 out:
 	if (vma)
 		return vma;
 
 	/* End of vmas has been reached */
-	m->version = (priv->tail_vma != NULL)? 0: -1UL;
+	m->version = (tail_vma != NULL)? 0: -1UL;
 	up_read(&mm->mmap_sem);
 	mmput(mm);
-	return priv->tail_vma;
+	return tail_vma;
 }
 
 static void vma_stop(struct proc_maps_private *priv, struct vm_area_struct *vma)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux