aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_trace.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2009-08-22 16:56:50 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-23 04:32:39 -0400
commit22f00b69f6a7e1e18e821979a23e8307c2de9888 (patch)
tree692adbe758da2d52aac9d564b6fd55363aa2fbf6 /kernel/rcutree_trace.c
parent65cf8f866fc0fb40fa9daaded7e938a886d6f7c5 (diff)
rcu: Use debugfs_remove_recursive() simplify code.
Suggested by Josh Triplett. Signed-off-by: Paul 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: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/rcutree_trace.c')
-rw-r--r--kernel/rcutree_trace.c45
1 files changed, 15 insertions, 30 deletions
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index ea4a47470371..31af3a0fb6d5 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -265,62 +265,47 @@ static struct file_operations rcu_pending_fops = {
265}; 265};
266 266
267static struct dentry *rcudir; 267static struct dentry *rcudir;
268static struct dentry *datadir;
269static struct dentry *datadir_csv;
270static struct dentry *gpdir;
271static struct dentry *hierdir;
272static struct dentry *rcu_pendingdir;
273 268
274static int __init rcuclassic_trace_init(void) 269static int __init rcuclassic_trace_init(void)
275{ 270{
271 struct dentry *retval;
272
276 rcudir = debugfs_create_dir("rcu", NULL); 273 rcudir = debugfs_create_dir("rcu", NULL);
277 if (!rcudir) 274 if (!rcudir)
278 goto out; 275 goto free_out;
279 276
280 datadir = debugfs_create_file("rcudata", 0444, rcudir, 277 retval = debugfs_create_file("rcudata", 0444, rcudir,
281 NULL, &rcudata_fops); 278 NULL, &rcudata_fops);
282 if (!datadir) 279 if (!retval)
283 goto free_out; 280 goto free_out;
284 281
285 datadir_csv = debugfs_create_file("rcudata.csv", 0444, rcudir, 282 retval = debugfs_create_file("rcudata.csv", 0444, rcudir,
286 NULL, &rcudata_csv_fops); 283 NULL, &rcudata_csv_fops);
287 if (!datadir_csv) 284 if (!retval)
288 goto free_out; 285 goto free_out;
289 286
290 gpdir = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops); 287 retval = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops);
291 if (!gpdir) 288 if (!retval)
292 goto free_out; 289 goto free_out;
293 290
294 hierdir = debugfs_create_file("rcuhier", 0444, rcudir, 291 retval = debugfs_create_file("rcuhier", 0444, rcudir,
295 NULL, &rcuhier_fops); 292 NULL, &rcuhier_fops);
296 if (!hierdir) 293 if (!retval)
297 goto free_out; 294 goto free_out;
298 295
299 rcu_pendingdir = debugfs_create_file("rcu_pending", 0444, rcudir, 296 retval = debugfs_create_file("rcu_pending", 0444, rcudir,
300 NULL, &rcu_pending_fops); 297 NULL, &rcu_pending_fops);
301 if (!rcu_pendingdir) 298 if (!retval)
302 goto free_out; 299 goto free_out;
303 return 0; 300 return 0;
304free_out: 301free_out:
305 if (datadir) 302 debugfs_remove_recursive(rcudir);
306 debugfs_remove(datadir);
307 if (datadir_csv)
308 debugfs_remove(datadir_csv);
309 if (gpdir)
310 debugfs_remove(gpdir);
311 debugfs_remove(rcudir);
312out:
313 return 1; 303 return 1;
314} 304}
315 305
316static void __exit rcuclassic_trace_cleanup(void) 306static void __exit rcuclassic_trace_cleanup(void)
317{ 307{
318 debugfs_remove(datadir); 308 debugfs_remove_recursive(rcudir);
319 debugfs_remove(datadir_csv);
320 debugfs_remove(gpdir);
321 debugfs_remove(hierdir);
322 debugfs_remove(rcu_pendingdir);
323 debugfs_remove(rcudir);
324} 309}
325 310
326 311