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

Commit 22f00b69 authored by Paul E. McKenney's avatar Paul E. McKenney Committed by Ingo Molnar
Browse files

rcu: Use debugfs_remove_recursive() simplify code.



Suggested by Josh Triplett.

Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: akpm@linux-foundation.org
Cc: mathieu.desnoyers@polymtl.ca
Cc: josht@linux.vnet.ibm.com
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
LKML-Reference: <12509746132173-git-send-email->
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 65cf8f86
Loading
Loading
Loading
Loading
+15 −30
Original line number Original line Diff line number Diff line
@@ -265,62 +265,47 @@ static struct file_operations rcu_pending_fops = {
};
};


static struct dentry *rcudir;
static struct dentry *rcudir;
static struct dentry *datadir;
static struct dentry *datadir_csv;
static struct dentry *gpdir;
static struct dentry *hierdir;
static struct dentry *rcu_pendingdir;


static int __init rcuclassic_trace_init(void)
static int __init rcuclassic_trace_init(void)
{
{
	struct dentry *retval;

	rcudir = debugfs_create_dir("rcu", NULL);
	rcudir = debugfs_create_dir("rcu", NULL);
	if (!rcudir)
	if (!rcudir)
		goto out;
		goto free_out;


	datadir = debugfs_create_file("rcudata", 0444, rcudir,
	retval = debugfs_create_file("rcudata", 0444, rcudir,
						NULL, &rcudata_fops);
						NULL, &rcudata_fops);
	if (!datadir)
	if (!retval)
		goto free_out;
		goto free_out;


	datadir_csv = debugfs_create_file("rcudata.csv", 0444, rcudir,
	retval = debugfs_create_file("rcudata.csv", 0444, rcudir,
						NULL, &rcudata_csv_fops);
						NULL, &rcudata_csv_fops);
	if (!datadir_csv)
	if (!retval)
		goto free_out;
		goto free_out;


	gpdir = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops);
	retval = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops);
	if (!gpdir)
	if (!retval)
		goto free_out;
		goto free_out;


	hierdir = debugfs_create_file("rcuhier", 0444, rcudir,
	retval = debugfs_create_file("rcuhier", 0444, rcudir,
						NULL, &rcuhier_fops);
						NULL, &rcuhier_fops);
	if (!hierdir)
	if (!retval)
		goto free_out;
		goto free_out;


	rcu_pendingdir = debugfs_create_file("rcu_pending", 0444, rcudir,
	retval = debugfs_create_file("rcu_pending", 0444, rcudir,
						NULL, &rcu_pending_fops);
						NULL, &rcu_pending_fops);
	if (!rcu_pendingdir)
	if (!retval)
		goto free_out;
		goto free_out;
	return 0;
	return 0;
free_out:
free_out:
	if (datadir)
	debugfs_remove_recursive(rcudir);
		debugfs_remove(datadir);
	if (datadir_csv)
		debugfs_remove(datadir_csv);
	if (gpdir)
		debugfs_remove(gpdir);
	debugfs_remove(rcudir);
out:
	return 1;
	return 1;
}
}


static void __exit rcuclassic_trace_cleanup(void)
static void __exit rcuclassic_trace_cleanup(void)
{
{
	debugfs_remove(datadir);
	debugfs_remove_recursive(rcudir);
	debugfs_remove(datadir_csv);
	debugfs_remove(gpdir);
	debugfs_remove(hierdir);
	debugfs_remove(rcu_pendingdir);
	debugfs_remove(rcudir);
}
}