Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce34fddb authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds
Browse files

fs/proc/task_nommu.c: change maps_open() to use __seq_open_private()



Cleanup and preparation. maps_open() can use __seq_open_private()
like proc_maps_open() does.

[akpm@linux-foundation.org: deuglify]
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: default avatarGreg Ungerer <gerg@uclinux.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 557c2d8a
Loading
Loading
Loading
Loading
+7 −14
Original line number Diff line number Diff line
@@ -269,20 +269,13 @@ static int maps_open(struct inode *inode, struct file *file,
		     const struct seq_operations *ops)
{
	struct proc_maps_private *priv;
	int ret = -ENOMEM;

	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
	if (priv) {
	priv = __seq_open_private(file, ops, sizeof(struct proc_maps_private));
	if (!priv)
		return -ENOMEM;

	priv->pid = proc_pid(inode);
		ret = seq_open(file, ops);
		if (!ret) {
			struct seq_file *m = file->private_data;
			m->private = priv;
		} else {
			kfree(priv);
		}
	}
	return ret;
	return 0;
}

static int pid_maps_open(struct inode *inode, struct file *file)