git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
d_path: Make proc_get_link() use a struct path argument
[pandora-kernel.git]
/
fs
/
proc
/
task_nommu.c
diff --git
a/fs/proc/task_nommu.c
b/fs/proc/task_nommu.c
index
7cddf6b
..
8011528
100644
(file)
--- a/
fs/proc/task_nommu.c
+++ b/
fs/proc/task_nommu.c
@@
-2,6
+2,7
@@
#include <linux/mm.h>
#include <linux/file.h>
#include <linux/mount.h>
#include <linux/mm.h>
#include <linux/file.h>
#include <linux/mount.h>
+#include <linux/ptrace.h>
#include <linux/seq_file.h>
#include "internal.h"
#include <linux/seq_file.h>
#include "internal.h"
@@
-11,7
+12,7
@@
* each process that owns it. Non-shared memory is counted
* accurately.
*/
* each process that owns it. Non-shared memory is counted
* accurately.
*/
-
char *task_mem(struct mm_struct *mm, char *buffer
)
+
void task_mem(struct seq_file *m, struct mm_struct *mm
)
{
struct vm_list_struct *vml;
unsigned long bytes = 0, sbytes = 0, slack = 0;
{
struct vm_list_struct *vml;
unsigned long bytes = 0, sbytes = 0, slack = 0;
@@
-57,14
+58,13
@@
char *task_mem(struct mm_struct *mm, char *buffer)
bytes += kobjsize(current); /* includes kernel stack */
bytes += kobjsize(current); /* includes kernel stack */
-
buffer += sprintf(buffer
,
+
seq_printf(m
,
"Mem:\t%8lu bytes\n"
"Slack:\t%8lu bytes\n"
"Shared:\t%8lu bytes\n",
bytes, slack, sbytes);
up_read(&mm->mmap_sem);
"Mem:\t%8lu bytes\n"
"Slack:\t%8lu bytes\n"
"Shared:\t%8lu bytes\n",
bytes, slack, sbytes);
up_read(&mm->mmap_sem);
- return buffer;
}
unsigned long task_vsize(struct mm_struct *mm)
}
unsigned long task_vsize(struct mm_struct *mm)
@@
-103,7
+103,7
@@
int task_statm(struct mm_struct *mm, int *shared, int *text,
return size;
}
return size;
}
-int proc_exe_link(struct inode *inode, struct
dentry **dentry, struct vfsmount **mnt
)
+int proc_exe_link(struct inode *inode, struct
path *path
)
{
struct vm_list_struct *vml;
struct vm_area_struct *vma;
{
struct vm_list_struct *vml;
struct vm_area_struct *vma;
@@
-126,8
+126,8
@@
int proc_exe_link(struct inode *inode, struct dentry **dentry, struct vfsmount *
}
if (vma) {
}
if (vma) {
- *
mnt = mntget(vma->vm_file->f_path.mnt)
;
-
*dentry = dget(vma->vm_file->f_path.dentry
);
+ *
path = vma->vm_file->f_path
;
+
path_get(&vma->vm_file->f_path
);
result = 0;
}
result = 0;
}
@@
-143,6
+143,12
@@
out:
static int show_map(struct seq_file *m, void *_vml)
{
struct vm_list_struct *vml = _vml;
static int show_map(struct seq_file *m, void *_vml)
{
struct vm_list_struct *vml = _vml;
+ struct proc_maps_private *priv = m->private;
+ struct task_struct *task = priv->task;
+
+ if (maps_protect && !ptrace_may_attach(task))
+ return -EACCES;
+
return nommu_vma_show(m, vml->vma);
}
return nommu_vma_show(m, vml->vma);
}
@@
-158,15
+164,13
@@
static void *m_start(struct seq_file *m, loff_t *pos)
if (!priv->task)
return NULL;
if (!priv->task)
return NULL;
- mm =
get_task_mm
(priv->task);
+ mm =
mm_for_maps
(priv->task);
if (!mm) {
put_task_struct(priv->task);
priv->task = NULL;
return NULL;
}
if (!mm) {
put_task_struct(priv->task);
priv->task = NULL;
return NULL;
}
- down_read(&mm->mmap_sem);
-
/* start from the Nth VMA */
for (vml = mm->context.vmlist; vml; vml = vml->next)
if (n-- == 0)
/* start from the Nth VMA */
for (vml = mm->context.vmlist; vml; vml = vml->next)
if (n-- == 0)
@@
-194,7
+198,7
@@
static void *m_next(struct seq_file *m, void *_vml, loff_t *pos)
return vml ? vml->next : NULL;
}
return vml ? vml->next : NULL;
}
-static struct seq_operations proc_pid_maps_ops = {
+static
const
struct seq_operations proc_pid_maps_ops = {
.start = m_start,
.next = m_next,
.stop = m_stop,
.start = m_start,
.next = m_next,
.stop = m_stop,