]> git.wh0rd.org - patches.git/blob - nommu-map-list-debug.patch
more random patches. who knows.
[patches.git] / nommu-map-list-debug.patch
1 --- fs/proc/task_nommu.c
2 +++ fs/proc/task_nommu.c.old
3 @@ -145,6 +145,8 @@
4 seq_printf(m, "%*c", len, ' ');
5 }
6
7 +#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s:%i: " fmt "\n", __FUNCTION__, __LINE__, ## args)
8 +
9 static int show_map(struct seq_file *m, void *v)
10 {
11 struct vm_list_struct *vml = v;
12 @@ -157,6 +159,8 @@
13 dev_t dev = 0;
14 int len;
15
16 +DPRINTK("!!! BOOYA");
17 +
18 if (file) {
19 struct inode *inode = vma->vm_file->f_dentry->d_inode;
20 dev = inode->i_sb->s_dev;
21 @@ -209,12 +213,15 @@
22 struct mm_struct *mm;
23 struct vm_list_struct *vml;
24 loff_t l = *pos;
25 +DPRINTK("!!! BOOYA l=%i", (int)l);
26
27 mm = get_task_mm(task);
28 if (!mm)
29 return NULL;
30
31 +DPRINTK("!!! BOOYA down_read(sem)");
32 down_read(&mm->mmap_sem);
33 +DPRINTK("!!! BOOYA");
34
35 /*
36 * Check the vml index is within the range and do
37 @@ -228,38 +235,57 @@
38 }
39
40 if (vml)
41 +{
42 +DPRINTK("!!! BOOYA <-- exit");
43 return vml;
44 +}
45
46 /* End of vmls has been reached */
47 +DPRINTK("!!! BOOYA up_read(sem)");
48 up_read(&mm->mmap_sem);
49 +DPRINTK("!!! BOOYA mmput(mm)");
50 mmput(mm);
51
52 +DPRINTK("!!! BOOYA <-- exit");
53 return NULL;
54 }
55 static void m_stop(struct seq_file *m, void *v)
56 {
57 struct task_struct *task = m->private;
58 struct mm_struct *mm;
59 +DPRINTK("!!! BOOYA --> enter");
60
61 if (!v)
62 return;
63
64 mm = get_task_mm(task);
65 if (!mm)
66 +{
67 +DPRINTK("!!! BOOYA <-- exit");
68 return;
69 +}
70
71 +DPRINTK("!!! BOOYA up_read(sem)");
72 up_read(&mm->mmap_sem);
73 +DPRINTK("!!! BOOYA mmput(mm)");
74 mmput(mm);
75 +DPRINTK("!!! BOOYA <-- exit");
76 }
77 static void *m_next(struct seq_file *m, void *v, loff_t *pos)
78 {
79 struct vm_list_struct *vml = v;
80 +DPRINTK("!!! BOOYA");
81
82 (*pos)++;
83 if (vml && vml->next)
84 +{
85 +DPRINTK("!!! BOOYA");
86 return vml->next;
87 +}
88
89 +DPRINTK("!!! BOOYA");
90 m_stop(m, vml);
91 +DPRINTK("!!! BOOYA");
92 return NULL;
93 }
94 struct seq_operations proc_pid_maps_op = {