/* 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 = proc_mounts(m);
+       struct proc_mounts *p = m->private;
 
        down_read(&namespace_sem);
        if (p->cached_event == p->ns->event) {
 
 static void *m_next(struct seq_file *m, void *v, loff_t *pos)
 {
-       struct proc_mounts *p = proc_mounts(m);
+       struct proc_mounts *p = m->private;
 
        p->cached_mount = seq_list_next(v, &p->ns->list, pos);
        p->cached_index = *pos;
 
 static int m_show(struct seq_file *m, void *v)
 {
-       struct proc_mounts *p = proc_mounts(m);
+       struct proc_mounts *p = m->private;
        struct mount *r = list_entry(v, struct mount, mnt_list);
        return p->show(m, &r->mnt);
 }
 
 
 static unsigned mounts_poll(struct file *file, poll_table *wait)
 {
-       struct proc_mounts *p = proc_mounts(file->private_data);
+       struct seq_file *m = file->private_data;
+       struct proc_mounts *p = m->private;
        struct mnt_namespace *ns = p->ns;
        unsigned res = POLLIN | POLLRDNORM;
        int event;
        poll_wait(file, &p->ns->poll, wait);
 
        event = ACCESS_ONCE(ns->event);
-       if (p->m.poll_event != event) {
-               p->m.poll_event = event;
+       if (m->poll_event != event) {
+               m->poll_event = event;
                res |= POLLERR | POLLPRI;
        }
 
 
 static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt)
 {
-       struct proc_mounts *p = proc_mounts(m);
+       struct proc_mounts *p = m->private;
        struct mount *r = real_mount(mnt);
        int err = 0;
        struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
 
 static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt)
 {
-       struct proc_mounts *p = proc_mounts(m);
+       struct proc_mounts *p = m->private;
        struct mount *r = real_mount(mnt);
        struct super_block *sb = mnt->mnt_sb;
        struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
 
 static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt)
 {
-       struct proc_mounts *p = proc_mounts(m);
+       struct proc_mounts *p = m->private;
        struct mount *r = real_mount(mnt);
        struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
        struct super_block *sb = mnt_path.dentry->d_sb;
        struct mnt_namespace *ns = NULL;
        struct path root;
        struct proc_mounts *p;
+       struct seq_file *m;
        int ret = -EINVAL;
 
        if (!task)
        task_unlock(task);
        put_task_struct(task);
 
-       ret = -ENOMEM;
-       p = kmalloc(sizeof(struct proc_mounts), GFP_KERNEL);
-       if (!p)
+       ret = seq_open_private(file, &mounts_op, sizeof(struct proc_mounts));
+       if (ret)
                goto err_put_path;
 
-       file->private_data = &p->m;
-       ret = seq_open(file, &mounts_op);
-       if (ret)
-               goto err_free;
+       m = file->private_data;
+       m->poll_event = ns->event;
 
+       p = m->private;
        p->ns = ns;
        p->root = root;
-       p->m.poll_event = ns->event;
        p->show = show;
        p->cached_event = ~0ULL;
 
        return 0;
 
- err_free:
-       kfree(p);
  err_put_path:
        path_put(&root);
  err_put_ns:
 
 static int mounts_release(struct inode *inode, struct file *file)
 {
-       struct proc_mounts *p = proc_mounts(file->private_data);
+       struct seq_file *m = file->private_data;
+       struct proc_mounts *p = m->private;
        path_put(&p->root);
        put_mnt_ns(p->ns);
-       return seq_release(inode, file);
+       return seq_release_private(inode, file);
 }
 
 static int mounts_open(struct inode *inode, struct file *file)