X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Fproc%2Ftask_nommu.c;h=4b4f9cc2f186a72705a2525367b8861b6889a0ad;hb=8757a5f71530c2dc8db7823ad68a5d4c2fbdad19;hp=1932c2ca345729580c60f5a0a2b8187779b9c450;hpb=6e5565f949af1322f8f3d3f43d044645ae448499;p=linux-2.6-omap-h63xx.git diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index 1932c2ca345..4b4f9cc2f18 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c @@ -1,6 +1,7 @@ #include #include +#include #include #include #include @@ -12,7 +13,7 @@ * 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; @@ -58,14 +59,13 @@ char *task_mem(struct mm_struct *mm, char *buffer) 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); - return buffer; } unsigned long task_vsize(struct mm_struct *mm) @@ -104,40 +104,6 @@ int task_statm(struct mm_struct *mm, int *shared, int *text, return size; } -int proc_exe_link(struct inode *inode, struct dentry **dentry, struct vfsmount **mnt) -{ - struct vm_list_struct *vml; - struct vm_area_struct *vma; - struct task_struct *task = get_proc_task(inode); - struct mm_struct *mm = get_task_mm(task); - int result = -ENOENT; - - if (!mm) - goto out; - down_read(&mm->mmap_sem); - - vml = mm->context.vmlist; - vma = NULL; - while (vml) { - if ((vml->vma->vm_flags & VM_EXECUTABLE) && vml->vma->vm_file) { - vma = vml->vma; - break; - } - vml = vml->next; - } - - if (vma) { - *mnt = mntget(vma->vm_file->f_path.mnt); - *dentry = dget(vma->vm_file->f_path.dentry); - result = 0; - } - - up_read(&mm->mmap_sem); - mmput(mm); -out: - return result; -} - /* * display mapping lines for a particular process's /proc/pid/maps */ @@ -199,7 +165,7 @@ static void *m_next(struct seq_file *m, void *_vml, loff_t *pos) 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,