aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-29 10:29:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-01 04:47:44 -0400
commitb145d7865a7c9cf61074d5648e6b02e775783ba6 (patch)
treeaec41df1c9a19cca21a4df3b8e00be94c4a4a483
parentd5bf5cf9e150512f04ef8ae7744964b052d2f061 (diff)
staging: lustre: get rid of ldebugfs_remove()
It was just a dumb wrapper around debugfs_remove_recursive() so just call the function properly. Also, there is no need to set the dentry to NULL, it's gone, who cares about it anymore... Cc: Oleg Drokin <oleg.drokin@intel.com> Cc: Andreas Dilger <andreas.dilger@intel.com> Cc: James Simmons <jsimmons@infradead.org> Cc: NeilBrown <neilb@suse.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Roman Storozhenko <romeusmeister@gmail.com> Cc: Aastha Gupta <aastha.gupta4104@gmail.com> Cc: Ben Evans <bevans@cray.com> Cc: Quentin Bouget <quentin.bouget@cea.fr> Cc: Arvind Yadav <arvind.yadav.cs@gmail.com> Cc: Arushi Singhal <arushisinghal19971997@gmail.com> Cc: Patrick Farrell <paf@cray.com> Cc: Aliaksei Karaliou <akaraliou.dev@gmail.com> Cc: Mathias Rav <mathiasrav@gmail.com> Cc: Andriy Skulysh <andriy.skulysh@seagate.com> Cc: Dafna Hirschfeld <dafna3@gmail.com> Cc: "Gustavo A. R. Silva" <garsilva@embeddedor.com> Cc: Bob Glosman <bob.glossman@intel.com> Cc: lustre-devel@lists.lustre.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/fid/fid_request.c6
-rw-r--r--drivers/staging/lustre/lustre/fld/fld_request.c6
-rw-r--r--drivers/staging/lustre/lustre/include/lprocfs_status.h2
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_pool.c5
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_resource.c21
-rw-r--r--drivers/staging/lustre/lustre/llite/lproc_llite.c14
-rw-r--r--drivers/staging/lustre/lustre/lov/lov_pool.c4
-rw-r--r--drivers/staging/lustre/lustre/obdclass/genops.c3
-rw-r--r--drivers/staging/lustre/lustre/obdclass/lprocfs_status.c10
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c6
-rw-r--r--drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c3
11 files changed, 22 insertions, 58 deletions
diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c
index bc748ab6645d..a34fd90ca5e5 100644
--- a/drivers/staging/lustre/lustre/fid/fid_request.c
+++ b/drivers/staging/lustre/lustre/fid/fid_request.c
@@ -291,8 +291,7 @@ EXPORT_SYMBOL(seq_client_flush);
291 291
292static void seq_client_debugfs_fini(struct lu_client_seq *seq) 292static void seq_client_debugfs_fini(struct lu_client_seq *seq)
293{ 293{
294 if (!IS_ERR_OR_NULL(seq->lcs_debugfs_entry)) 294 debugfs_remove_recursive(seq->lcs_debugfs_entry);
295 ldebugfs_remove(&seq->lcs_debugfs_entry);
296} 295}
297 296
298static void seq_client_debugfs_init(struct lu_client_seq *seq) 297static void seq_client_debugfs_init(struct lu_client_seq *seq)
@@ -399,8 +398,7 @@ static int __init fid_init(void)
399 398
400static void __exit fid_exit(void) 399static void __exit fid_exit(void)
401{ 400{
402 if (!IS_ERR_OR_NULL(seq_debugfs_dir)) 401 debugfs_remove_recursive(seq_debugfs_dir);
403 ldebugfs_remove(&seq_debugfs_dir);
404} 402}
405 403
406MODULE_AUTHOR("OpenSFS, Inc. <http://www.lustre.org/>"); 404MODULE_AUTHOR("OpenSFS, Inc. <http://www.lustre.org/>");
diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c b/drivers/staging/lustre/lustre/fld/fld_request.c
index cb67fee19451..97f7ea632346 100644
--- a/drivers/staging/lustre/lustre/fld/fld_request.c
+++ b/drivers/staging/lustre/lustre/fld/fld_request.c
@@ -227,8 +227,7 @@ static void fld_client_debugfs_init(struct lu_client_fld *fld)
227 227
228void fld_client_debugfs_fini(struct lu_client_fld *fld) 228void fld_client_debugfs_fini(struct lu_client_fld *fld)
229{ 229{
230 if (!IS_ERR_OR_NULL(fld->lcf_debugfs_entry)) 230 debugfs_remove_recursive(fld->lcf_debugfs_entry);
231 ldebugfs_remove(&fld->lcf_debugfs_entry);
232} 231}
233EXPORT_SYMBOL(fld_client_debugfs_fini); 232EXPORT_SYMBOL(fld_client_debugfs_fini);
234 233
@@ -435,8 +434,7 @@ static int __init fld_init(void)
435 434
436static void __exit fld_exit(void) 435static void __exit fld_exit(void)
437{ 436{
438 if (!IS_ERR_OR_NULL(fld_debugfs_dir)) 437 debugfs_remove_recursive(fld_debugfs_dir);
439 ldebugfs_remove(&fld_debugfs_dir);
440} 438}
441 439
442MODULE_AUTHOR("OpenSFS, Inc. <http://www.lustre.org/>"); 440MODULE_AUTHOR("OpenSFS, Inc. <http://www.lustre.org/>");
diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index b18bcb337504..495e6f5f676b 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -453,8 +453,6 @@ extern const struct file_operations lprocfs_stats_seq_fops;
453void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *var, 453void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *var,
454 void *data); 454 void *data);
455 455
456void ldebugfs_remove(struct dentry **entryp);
457
458int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list, 456int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
459 const struct attribute_group *attrs); 457 const struct attribute_group *attrs);
460int lprocfs_obd_cleanup(struct obd_device *obd); 458int lprocfs_obd_cleanup(struct obd_device *obd);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index 146b348ca312..36d14ee4e5b1 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -640,10 +640,7 @@ static void ldlm_pool_debugfs_fini(struct ldlm_pool *pl)
640 lprocfs_free_stats(&pl->pl_stats); 640 lprocfs_free_stats(&pl->pl_stats);
641 pl->pl_stats = NULL; 641 pl->pl_stats = NULL;
642 } 642 }
643 if (pl->pl_debugfs_entry) { 643 debugfs_remove_recursive(pl->pl_debugfs_entry);
644 ldebugfs_remove(&pl->pl_debugfs_entry);
645 pl->pl_debugfs_entry = NULL;
646 }
647} 644}
648 645
649int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns, 646int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 6b94a2b2a0fc..c93b019b8e37 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -121,18 +121,9 @@ void ldlm_debugfs_setup(void)
121 121
122void ldlm_debugfs_cleanup(void) 122void ldlm_debugfs_cleanup(void)
123{ 123{
124 if (!IS_ERR_OR_NULL(ldlm_svc_debugfs_dir)) 124 debugfs_remove_recursive(ldlm_svc_debugfs_dir);
125 ldebugfs_remove(&ldlm_svc_debugfs_dir); 125 debugfs_remove_recursive(ldlm_ns_debugfs_dir);
126 126 debugfs_remove_recursive(ldlm_debugfs_dir);
127 if (!IS_ERR_OR_NULL(ldlm_ns_debugfs_dir))
128 ldebugfs_remove(&ldlm_ns_debugfs_dir);
129
130 if (!IS_ERR_OR_NULL(ldlm_debugfs_dir))
131 ldebugfs_remove(&ldlm_debugfs_dir);
132
133 ldlm_svc_debugfs_dir = NULL;
134 ldlm_ns_debugfs_dir = NULL;
135 ldlm_debugfs_dir = NULL;
136} 127}
137 128
138static ssize_t resource_count_show(struct kobject *kobj, struct attribute *attr, 129static ssize_t resource_count_show(struct kobject *kobj, struct attribute *attr,
@@ -358,11 +349,7 @@ static struct kobj_type ldlm_ns_ktype = {
358 349
359static void ldlm_namespace_debugfs_unregister(struct ldlm_namespace *ns) 350static void ldlm_namespace_debugfs_unregister(struct ldlm_namespace *ns)
360{ 351{
361 if (IS_ERR_OR_NULL(ns->ns_debugfs_entry)) 352 debugfs_remove_recursive(ns->ns_debugfs_entry);
362 CERROR("dlm namespace %s has no procfs dir?\n",
363 ldlm_ns_name(ns));
364 else
365 ldebugfs_remove(&ns->ns_debugfs_entry);
366 353
367 if (ns->ns_stats) 354 if (ns->ns_stats)
368 lprocfs_free_stats(&ns->ns_stats); 355 lprocfs_free_stats(&ns->ns_stats);
diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index d2f42c727ed4..49bf1b7ee311 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -1234,7 +1234,7 @@ int ldebugfs_register_mountpoint(struct dentry *parent,
1234 obd->obd_type->typ_name); 1234 obd->obd_type->typ_name);
1235out: 1235out:
1236 if (err) { 1236 if (err) {
1237 ldebugfs_remove(&sbi->ll_debugfs_entry); 1237 debugfs_remove_recursive(sbi->ll_debugfs_entry);
1238 lprocfs_free_stats(&sbi->ll_ra_stats); 1238 lprocfs_free_stats(&sbi->ll_ra_stats);
1239 lprocfs_free_stats(&sbi->ll_stats); 1239 lprocfs_free_stats(&sbi->ll_stats);
1240 } 1240 }
@@ -1243,13 +1243,11 @@ out:
1243 1243
1244void ldebugfs_unregister_mountpoint(struct ll_sb_info *sbi) 1244void ldebugfs_unregister_mountpoint(struct ll_sb_info *sbi)
1245{ 1245{
1246 if (sbi->ll_debugfs_entry) { 1246 debugfs_remove_recursive(sbi->ll_debugfs_entry);
1247 ldebugfs_remove(&sbi->ll_debugfs_entry); 1247 kobject_put(&sbi->ll_kobj);
1248 kobject_put(&sbi->ll_kobj); 1248 wait_for_completion(&sbi->ll_kobj_unregister);
1249 wait_for_completion(&sbi->ll_kobj_unregister); 1249 lprocfs_free_stats(&sbi->ll_ra_stats);
1250 lprocfs_free_stats(&sbi->ll_ra_stats); 1250 lprocfs_free_stats(&sbi->ll_stats);
1251 lprocfs_free_stats(&sbi->ll_stats);
1252 }
1253} 1251}
1254 1252
1255#undef MAX_STRING_SIZE 1253#undef MAX_STRING_SIZE
diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c b/drivers/staging/lustre/lustre/lov/lov_pool.c
index 9ce7038c9b0e..b2a88ba72eb2 100644
--- a/drivers/staging/lustre/lustre/lov/lov_pool.c
+++ b/drivers/staging/lustre/lustre/lov/lov_pool.c
@@ -410,7 +410,7 @@ out_err:
410 list_del_init(&new_pool->pool_list); 410 list_del_init(&new_pool->pool_list);
411 lov->lov_pool_count--; 411 lov->lov_pool_count--;
412 spin_unlock(&obd->obd_dev_lock); 412 spin_unlock(&obd->obd_dev_lock);
413 ldebugfs_remove(&new_pool->pool_debugfs_entry); 413 debugfs_remove_recursive(new_pool->pool_debugfs_entry);
414 lov_ost_pool_free(&new_pool->pool_obds); 414 lov_ost_pool_free(&new_pool->pool_obds);
415 kfree(new_pool); 415 kfree(new_pool);
416 416
@@ -435,7 +435,7 @@ int lov_pool_del(struct obd_device *obd, char *poolname)
435 if (!pool) 435 if (!pool)
436 return -ENOENT; 436 return -ENOENT;
437 437
438 ldebugfs_remove(&pool->pool_debugfs_entry); 438 debugfs_remove_recursive(pool->pool_debugfs_entry);
439 lov_pool_putref(pool); 439 lov_pool_putref(pool);
440 440
441 spin_lock(&obd->obd_dev_lock); 441 spin_lock(&obd->obd_dev_lock);
diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c
index 3771452b836c..234f383ce6d9 100644
--- a/drivers/staging/lustre/lustre/obdclass/genops.c
+++ b/drivers/staging/lustre/lustre/obdclass/genops.c
@@ -224,8 +224,7 @@ int class_unregister_type(const char *name)
224 if (type->typ_kobj) 224 if (type->typ_kobj)
225 kobject_put(type->typ_kobj); 225 kobject_put(type->typ_kobj);
226 226
227 if (!IS_ERR_OR_NULL(type->typ_debugfs_entry)) 227 debugfs_remove_recursive(type->typ_debugfs_entry);
228 ldebugfs_remove(&type->typ_debugfs_entry);
229 228
230 if (type->typ_lu) 229 if (type->typ_lu)
231 lu_device_type_fini(type->typ_lu); 230 lu_device_type_fini(type->typ_lu);
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index a8299a8cdad9..bdbe6f52031a 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -328,13 +328,6 @@ void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *list,
328} 328}
329EXPORT_SYMBOL_GPL(ldebugfs_add_vars); 329EXPORT_SYMBOL_GPL(ldebugfs_add_vars);
330 330
331void ldebugfs_remove(struct dentry **entryp)
332{
333 debugfs_remove_recursive(*entryp);
334 *entryp = NULL;
335}
336EXPORT_SYMBOL_GPL(ldebugfs_remove);
337
338/* Generic callbacks */ 331/* Generic callbacks */
339static ssize_t uuid_show(struct kobject *kobj, struct attribute *attr, 332static ssize_t uuid_show(struct kobject *kobj, struct attribute *attr,
340 char *buf) 333 char *buf)
@@ -1010,8 +1003,7 @@ int lprocfs_obd_cleanup(struct obd_device *obd)
1010 if (!obd) 1003 if (!obd)
1011 return -EINVAL; 1004 return -EINVAL;
1012 1005
1013 if (!IS_ERR_OR_NULL(obd->obd_debugfs_entry)) 1006 debugfs_remove_recursive(obd->obd_debugfs_entry);
1014 ldebugfs_remove(&obd->obd_debugfs_entry);
1015 1007
1016 kobject_put(&obd->obd_kobj); 1008 kobject_put(&obd->obd_kobj);
1017 wait_for_completion(&obd->obd_kobj_unregister); 1009 wait_for_completion(&obd->obd_kobj_unregister);
diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
index 62404b08f390..0b638837f88b 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
@@ -1158,8 +1158,7 @@ EXPORT_SYMBOL(ptlrpc_lprocfs_brw);
1158 1158
1159void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc) 1159void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc)
1160{ 1160{
1161 if (!IS_ERR_OR_NULL(svc->srv_debugfs_entry)) 1161 debugfs_remove_recursive(svc->srv_debugfs_entry);
1162 ldebugfs_remove(&svc->srv_debugfs_entry);
1163 1162
1164 if (svc->srv_stats) 1163 if (svc->srv_stats)
1165 lprocfs_free_stats(&svc->srv_stats); 1164 lprocfs_free_stats(&svc->srv_stats);
@@ -1167,8 +1166,7 @@ void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc)
1167 1166
1168void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd) 1167void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd)
1169{ 1168{
1170 if (!IS_ERR_OR_NULL(obd->obd_svc_debugfs_entry)) 1169 debugfs_remove_recursive(obd->obd_svc_debugfs_entry);
1171 ldebugfs_remove(&obd->obd_svc_debugfs_entry);
1172 1170
1173 if (obd->obd_svc_stats) 1171 if (obd->obd_svc_stats)
1174 lprocfs_free_stats(&obd->obd_svc_stats); 1172 lprocfs_free_stats(&obd->obd_svc_stats);
diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c
index e8076dc7c950..2bb75ebd5d98 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c
@@ -166,6 +166,5 @@ void sptlrpc_lproc_init(void)
166 166
167void sptlrpc_lproc_fini(void) 167void sptlrpc_lproc_fini(void)
168{ 168{
169 if (!IS_ERR_OR_NULL(sptlrpc_debugfs_dir)) 169 debugfs_remove_recursive(sptlrpc_debugfs_dir);
170 ldebugfs_remove(&sptlrpc_debugfs_dir);
171} 170}