Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200635
b: refs/heads/master
c: 3c26c9d
h: refs/heads/master
i:
  200633: cdb841a
  200631: 38f407e
v: v3
  • Loading branch information
Mike Frysinger authored and Linus Torvalds committed Jun 29, 2010
1 parent 4a4b76d commit e205112
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e621ba9932aa0a90e47c12c958b3a3104915f3b9
refs/heads/master: 3c26c9d9597f982973b9b3a32364230096ab0d78
20 changes: 16 additions & 4 deletions trunk/fs/proc/task_nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,20 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
return size;
}

static void pad_len_spaces(struct seq_file *m, int len)
{
len = 25 + sizeof(void*) * 6 - len;
if (len < 1)
len = 1;
seq_printf(m, "%*c", len, ' ');
}

/*
* display a single VMA to a sequenced file
*/
static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma)
{
struct mm_struct *mm = vma->vm_mm;
unsigned long ino = 0;
struct file *file;
dev_t dev = 0;
Expand Down Expand Up @@ -155,11 +164,14 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma)
MAJOR(dev), MINOR(dev), ino, &len);

if (file) {
len = 25 + sizeof(void *) * 6 - len;
if (len < 1)
len = 1;
seq_printf(m, "%*c", len, ' ');
pad_len_spaces(m, len);
seq_path(m, &file->f_path, "");
} else if (mm) {
if (vma->vm_start <= mm->start_stack &&
vma->vm_end >= mm->start_stack) {
pad_len_spaces(m, len);
seq_puts(m, "[stack]");
}
}

seq_putc(m, '\n');
Expand Down

0 comments on commit e205112

Please sign in to comment.