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>
This commit is contained in:
Greg Kroah-Hartman 2018-05-29 16:29:47 +02:00
parent d5bf5cf9e1
commit b145d7865a
11 changed files with 22 additions and 58 deletions

View file

@ -291,8 +291,7 @@ EXPORT_SYMBOL(seq_client_flush);
static void seq_client_debugfs_fini(struct lu_client_seq *seq)
{
if (!IS_ERR_OR_NULL(seq->lcs_debugfs_entry))
ldebugfs_remove(&seq->lcs_debugfs_entry);
debugfs_remove_recursive(seq->lcs_debugfs_entry);
}
static void seq_client_debugfs_init(struct lu_client_seq *seq)
@ -399,8 +398,7 @@ static int __init fid_init(void)
static void __exit fid_exit(void)
{
if (!IS_ERR_OR_NULL(seq_debugfs_dir))
ldebugfs_remove(&seq_debugfs_dir);
debugfs_remove_recursive(seq_debugfs_dir);
}
MODULE_AUTHOR("OpenSFS, Inc. <http://www.lustre.org/>");

View file

@ -227,8 +227,7 @@ static void fld_client_debugfs_init(struct lu_client_fld *fld)
void fld_client_debugfs_fini(struct lu_client_fld *fld)
{
if (!IS_ERR_OR_NULL(fld->lcf_debugfs_entry))
ldebugfs_remove(&fld->lcf_debugfs_entry);
debugfs_remove_recursive(fld->lcf_debugfs_entry);
}
EXPORT_SYMBOL(fld_client_debugfs_fini);
@ -435,8 +434,7 @@ static int __init fld_init(void)
static void __exit fld_exit(void)
{
if (!IS_ERR_OR_NULL(fld_debugfs_dir))
ldebugfs_remove(&fld_debugfs_dir);
debugfs_remove_recursive(fld_debugfs_dir);
}
MODULE_AUTHOR("OpenSFS, Inc. <http://www.lustre.org/>");

View file

@ -453,8 +453,6 @@ extern const struct file_operations lprocfs_stats_seq_fops;
void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *var,
void *data);
void ldebugfs_remove(struct dentry **entryp);
int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
const struct attribute_group *attrs);
int lprocfs_obd_cleanup(struct obd_device *obd);

View file

@ -640,10 +640,7 @@ static void ldlm_pool_debugfs_fini(struct ldlm_pool *pl)
lprocfs_free_stats(&pl->pl_stats);
pl->pl_stats = NULL;
}
if (pl->pl_debugfs_entry) {
ldebugfs_remove(&pl->pl_debugfs_entry);
pl->pl_debugfs_entry = NULL;
}
debugfs_remove_recursive(pl->pl_debugfs_entry);
}
int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,

View file

@ -121,18 +121,9 @@ void ldlm_debugfs_setup(void)
void ldlm_debugfs_cleanup(void)
{
if (!IS_ERR_OR_NULL(ldlm_svc_debugfs_dir))
ldebugfs_remove(&ldlm_svc_debugfs_dir);
if (!IS_ERR_OR_NULL(ldlm_ns_debugfs_dir))
ldebugfs_remove(&ldlm_ns_debugfs_dir);
if (!IS_ERR_OR_NULL(ldlm_debugfs_dir))
ldebugfs_remove(&ldlm_debugfs_dir);
ldlm_svc_debugfs_dir = NULL;
ldlm_ns_debugfs_dir = NULL;
ldlm_debugfs_dir = NULL;
debugfs_remove_recursive(ldlm_svc_debugfs_dir);
debugfs_remove_recursive(ldlm_ns_debugfs_dir);
debugfs_remove_recursive(ldlm_debugfs_dir);
}
static ssize_t resource_count_show(struct kobject *kobj, struct attribute *attr,
@ -358,11 +349,7 @@ static struct kobj_type ldlm_ns_ktype = {
static void ldlm_namespace_debugfs_unregister(struct ldlm_namespace *ns)
{
if (IS_ERR_OR_NULL(ns->ns_debugfs_entry))
CERROR("dlm namespace %s has no procfs dir?\n",
ldlm_ns_name(ns));
else
ldebugfs_remove(&ns->ns_debugfs_entry);
debugfs_remove_recursive(ns->ns_debugfs_entry);
if (ns->ns_stats)
lprocfs_free_stats(&ns->ns_stats);

View file

@ -1234,7 +1234,7 @@ int ldebugfs_register_mountpoint(struct dentry *parent,
obd->obd_type->typ_name);
out:
if (err) {
ldebugfs_remove(&sbi->ll_debugfs_entry);
debugfs_remove_recursive(sbi->ll_debugfs_entry);
lprocfs_free_stats(&sbi->ll_ra_stats);
lprocfs_free_stats(&sbi->ll_stats);
}
@ -1243,13 +1243,11 @@ out:
void ldebugfs_unregister_mountpoint(struct ll_sb_info *sbi)
{
if (sbi->ll_debugfs_entry) {
ldebugfs_remove(&sbi->ll_debugfs_entry);
kobject_put(&sbi->ll_kobj);
wait_for_completion(&sbi->ll_kobj_unregister);
lprocfs_free_stats(&sbi->ll_ra_stats);
lprocfs_free_stats(&sbi->ll_stats);
}
debugfs_remove_recursive(sbi->ll_debugfs_entry);
kobject_put(&sbi->ll_kobj);
wait_for_completion(&sbi->ll_kobj_unregister);
lprocfs_free_stats(&sbi->ll_ra_stats);
lprocfs_free_stats(&sbi->ll_stats);
}
#undef MAX_STRING_SIZE

View file

@ -410,7 +410,7 @@ out_err:
list_del_init(&new_pool->pool_list);
lov->lov_pool_count--;
spin_unlock(&obd->obd_dev_lock);
ldebugfs_remove(&new_pool->pool_debugfs_entry);
debugfs_remove_recursive(new_pool->pool_debugfs_entry);
lov_ost_pool_free(&new_pool->pool_obds);
kfree(new_pool);
@ -435,7 +435,7 @@ int lov_pool_del(struct obd_device *obd, char *poolname)
if (!pool)
return -ENOENT;
ldebugfs_remove(&pool->pool_debugfs_entry);
debugfs_remove_recursive(pool->pool_debugfs_entry);
lov_pool_putref(pool);
spin_lock(&obd->obd_dev_lock);

View file

@ -224,8 +224,7 @@ int class_unregister_type(const char *name)
if (type->typ_kobj)
kobject_put(type->typ_kobj);
if (!IS_ERR_OR_NULL(type->typ_debugfs_entry))
ldebugfs_remove(&type->typ_debugfs_entry);
debugfs_remove_recursive(type->typ_debugfs_entry);
if (type->typ_lu)
lu_device_type_fini(type->typ_lu);

View file

@ -328,13 +328,6 @@ void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *list,
}
EXPORT_SYMBOL_GPL(ldebugfs_add_vars);
void ldebugfs_remove(struct dentry **entryp)
{
debugfs_remove_recursive(*entryp);
*entryp = NULL;
}
EXPORT_SYMBOL_GPL(ldebugfs_remove);
/* Generic callbacks */
static ssize_t uuid_show(struct kobject *kobj, struct attribute *attr,
char *buf)
@ -1010,8 +1003,7 @@ int lprocfs_obd_cleanup(struct obd_device *obd)
if (!obd)
return -EINVAL;
if (!IS_ERR_OR_NULL(obd->obd_debugfs_entry))
ldebugfs_remove(&obd->obd_debugfs_entry);
debugfs_remove_recursive(obd->obd_debugfs_entry);
kobject_put(&obd->obd_kobj);
wait_for_completion(&obd->obd_kobj_unregister);

View file

@ -1158,8 +1158,7 @@ EXPORT_SYMBOL(ptlrpc_lprocfs_brw);
void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc)
{
if (!IS_ERR_OR_NULL(svc->srv_debugfs_entry))
ldebugfs_remove(&svc->srv_debugfs_entry);
debugfs_remove_recursive(svc->srv_debugfs_entry);
if (svc->srv_stats)
lprocfs_free_stats(&svc->srv_stats);
@ -1167,8 +1166,7 @@ void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc)
void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd)
{
if (!IS_ERR_OR_NULL(obd->obd_svc_debugfs_entry))
ldebugfs_remove(&obd->obd_svc_debugfs_entry);
debugfs_remove_recursive(obd->obd_svc_debugfs_entry);
if (obd->obd_svc_stats)
lprocfs_free_stats(&obd->obd_svc_stats);

View file

@ -166,6 +166,5 @@ void sptlrpc_lproc_init(void)
void sptlrpc_lproc_fini(void)
{
if (!IS_ERR_OR_NULL(sptlrpc_debugfs_dir))
ldebugfs_remove(&sptlrpc_debugfs_dir);
debugfs_remove_recursive(sptlrpc_debugfs_dir);
}