Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312871
b: refs/heads/master
c: 6ce6e24
h: refs/heads/master
i:
  312869: 2c5ffaf
  312867: a08f86b
  312863: 922541b
v: v3
  • Loading branch information
Al Viro committed Jul 14, 2012
1 parent 0230265 commit 7e0c4e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 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: f7a99c5b7c8bd3d3f533c8b38274e33f3da9096e
refs/heads/master: 6ce6e24e72233073c8ead9419fc5040d44803dae
4 changes: 3 additions & 1 deletion trunk/fs/mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ static inline void get_mnt_ns(struct mnt_namespace *ns)
}

struct proc_mounts {
struct seq_file m; /* must be the first element */
struct seq_file m;
struct mnt_namespace *ns;
struct path root;
int (*show)(struct seq_file *, struct vfsmount *);
};

#define proc_mounts(p) (container_of((p), struct proc_mounts, m))

extern const struct seq_operations mounts_op;
6 changes: 3 additions & 3 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,15 +923,15 @@ EXPORT_SYMBOL(replace_mount_options);
/* iterator; we want it to have access to namespace_sem, thus here... */
static void *m_start(struct seq_file *m, loff_t *pos)
{
struct proc_mounts *p = container_of(m, struct proc_mounts, m);
struct proc_mounts *p = proc_mounts(m);

down_read(&namespace_sem);
return seq_list_start(&p->ns->list, *pos);
}

static void *m_next(struct seq_file *m, void *v, loff_t *pos)
{
struct proc_mounts *p = container_of(m, struct proc_mounts, m);
struct proc_mounts *p = proc_mounts(m);

return seq_list_next(v, &p->ns->list, pos);
}
Expand All @@ -943,7 +943,7 @@ static void m_stop(struct seq_file *m, void *v)

static int m_show(struct seq_file *m, void *v)
{
struct proc_mounts *p = container_of(m, struct proc_mounts, m);
struct proc_mounts *p = proc_mounts(m);
struct mount *r = list_entry(v, struct mount, mnt_list);
return p->show(m, &r->mnt);
}
Expand Down
7 changes: 3 additions & 4 deletions trunk/fs/proc_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

static unsigned mounts_poll(struct file *file, poll_table *wait)
{
struct proc_mounts *p = file->private_data;
struct proc_mounts *p = proc_mounts(file->private_data);
struct mnt_namespace *ns = p->ns;
unsigned res = POLLIN | POLLRDNORM;

Expand Down Expand Up @@ -121,7 +121,7 @@ static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt)

static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt)
{
struct proc_mounts *p = m->private;
struct proc_mounts *p = proc_mounts(m);
struct mount *r = real_mount(mnt);
struct super_block *sb = mnt->mnt_sb;
struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
Expand Down Expand Up @@ -268,7 +268,6 @@ static int mounts_open_common(struct inode *inode, struct file *file,
if (ret)
goto err_free;

p->m.private = p;
p->ns = ns;
p->root = root;
p->m.poll_event = ns->event;
Expand All @@ -288,7 +287,7 @@ static int mounts_open_common(struct inode *inode, struct file *file,

static int mounts_release(struct inode *inode, struct file *file)
{
struct proc_mounts *p = file->private_data;
struct proc_mounts *p = proc_mounts(file->private_data);
path_put(&p->root);
put_mnt_ns(p->ns);
return seq_release(inode, file);
Expand Down

0 comments on commit 7e0c4e3

Please sign in to comment.