Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30245
b: refs/heads/master
c: 662795d
h: refs/heads/master
i:
  30243: 80986e5
v: v3
  • Loading branch information
Eric W. Biederman authored and Linus Torvalds committed Jun 26, 2006
1 parent 19f744f commit 27f0cf7
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 66 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: 6e66b52bf587f0dd9a8e0a581b9570e5c1969e33
refs/heads/master: 662795deb854b31501e0ffb42b7f0cce802c134a
61 changes: 0 additions & 61 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,67 +539,6 @@ static int proc_check_chroot(struct dentry *de, struct vfsmount *mnt)
goto exit;
}

extern struct seq_operations proc_pid_maps_op;
static int maps_open(struct inode *inode, struct file *file)
{
struct task_struct *task = proc_task(inode);
int ret = seq_open(file, &proc_pid_maps_op);
if (!ret) {
struct seq_file *m = file->private_data;
m->private = task;
}
return ret;
}

static struct file_operations proc_maps_operations = {
.open = maps_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};

#ifdef CONFIG_NUMA
extern struct seq_operations proc_pid_numa_maps_op;
static int numa_maps_open(struct inode *inode, struct file *file)
{
struct task_struct *task = proc_task(inode);
int ret = seq_open(file, &proc_pid_numa_maps_op);
if (!ret) {
struct seq_file *m = file->private_data;
m->private = task;
}
return ret;
}

static struct file_operations proc_numa_maps_operations = {
.open = numa_maps_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
#endif

#ifdef CONFIG_MMU
extern struct seq_operations proc_pid_smaps_op;
static int smaps_open(struct inode *inode, struct file *file)
{
struct task_struct *task = proc_task(inode);
int ret = seq_open(file, &proc_pid_smaps_op);
if (!ret) {
struct seq_file *m = file->private_data;
m->private = task;
}
return ret;
}

static struct file_operations proc_smaps_operations = {
.open = smaps_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
#endif

extern struct seq_operations mounts_op;
struct proc_mounts {
struct seq_file m;
Expand Down
4 changes: 4 additions & 0 deletions trunk/fs/proc/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ extern int proc_tgid_stat(struct task_struct *, char *);
extern int proc_pid_status(struct task_struct *, char *);
extern int proc_pid_statm(struct task_struct *, char *);

extern struct file_operations proc_maps_operations;
extern struct file_operations proc_numa_maps_operations;
extern struct file_operations proc_smaps_operations;

void free_proc_entry(struct proc_dir_entry *de);

int proc_init_inodecache(void);
Expand Down
54 changes: 51 additions & 3 deletions trunk/fs/proc/task_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,27 +374,75 @@ static void *m_next(struct seq_file *m, void *v, loff_t *pos)
return (vma != tail_vma)? tail_vma: NULL;
}

struct seq_operations proc_pid_maps_op = {
static struct seq_operations proc_pid_maps_op = {
.start = m_start,
.next = m_next,
.stop = m_stop,
.show = show_map
};

struct seq_operations proc_pid_smaps_op = {
static struct seq_operations proc_pid_smaps_op = {
.start = m_start,
.next = m_next,
.stop = m_stop,
.show = show_smap
};

static int do_maps_open(struct inode *inode, struct file *file,
struct seq_operations *ops)
{
struct task_struct *task = proc_task(inode);
int ret = seq_open(file, ops);
if (!ret) {
struct seq_file *m = file->private_data;
m->private = task;
}
return ret;
}

static int maps_open(struct inode *inode, struct file *file)
{
return do_maps_open(inode, file, &proc_pid_maps_op);
}

struct file_operations proc_maps_operations = {
.open = maps_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};

#ifdef CONFIG_NUMA
extern int show_numa_map(struct seq_file *m, void *v);

struct seq_operations proc_pid_numa_maps_op = {
static struct seq_operations proc_pid_numa_maps_op = {
.start = m_start,
.next = m_next,
.stop = m_stop,
.show = show_numa_map
};

static int numa_maps_open(struct inode *inode, struct file *file)
{
return do_maps_open(inode, file, &proc_pid_numa_maps_op);
}

struct file_operations proc_numa_maps_operations = {
.open = numa_maps_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
#endif

static int smaps_open(struct inode *inode, struct file *file)
{
return do_maps_open(inode, file, &proc_pid_smaps_op);
}

struct file_operations proc_smaps_operations = {
.open = smaps_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};
21 changes: 20 additions & 1 deletion trunk/fs/proc/task_nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,28 @@ static void *m_next(struct seq_file *m, void *v, loff_t *pos)
{
return NULL;
}
struct seq_operations proc_pid_maps_op = {
static struct seq_operations proc_pid_maps_op = {
.start = m_start,
.next = m_next,
.stop = m_stop,
.show = show_map
};

static int maps_open(struct inode *inode, struct file *file)
{
int ret;
ret = seq_open(file, &proc_pid_maps_op);
if (!ret) {
struct seq_file *m = file->private_data;
m->private = NULL;
}
return ret;
}

struct file_operations proc_maps_operations = {
.open = maps_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};

0 comments on commit 27f0cf7

Please sign in to comment.