mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 04:34:08 +08:00
e581595ea2
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Also, because there is no need to save the file dentry, remove all of the variables that were being saved, and just recursively delete the whole directory when shutting down, saving a lot of logic and local variables. [gregkh@linuxfoundation.org: v2] Link: http://lkml.kernel.org/r/20190613055455.GE19717@kroah.com Link: http://lkml.kernel.org/r/20190612152912.GA19151@kroah.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com> Cc: Mark Fasheh <mark@fasheh.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Joseph Qi <joseph.qi@linux.alibaba.com> Cc: Jia Guo <guojia12@huawei.com> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Changwei Ge <gechangwei@live.cn> Cc: Gang He <ghe@suse.com> Cc: Jun Piao <piaojun@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
64 lines
1.3 KiB
C
64 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/* -*- mode: c; c-basic-offset: 8; -*-
|
|
* vim: noexpandtab sw=8 ts=8 sts=0:
|
|
*
|
|
* dlmdebug.h
|
|
*
|
|
* Copyright (C) 2008 Oracle. All rights reserved.
|
|
*/
|
|
|
|
#ifndef DLMDEBUG_H
|
|
#define DLMDEBUG_H
|
|
|
|
void dlm_print_one_mle(struct dlm_master_list_entry *mle);
|
|
|
|
#ifdef CONFIG_DEBUG_FS
|
|
|
|
struct dlm_debug_ctxt {
|
|
struct dentry *debug_state_dentry;
|
|
struct dentry *debug_lockres_dentry;
|
|
struct dentry *debug_mle_dentry;
|
|
struct dentry *debug_purgelist_dentry;
|
|
};
|
|
|
|
struct debug_lockres {
|
|
int dl_len;
|
|
char *dl_buf;
|
|
struct dlm_ctxt *dl_ctxt;
|
|
struct dlm_lock_resource *dl_res;
|
|
};
|
|
|
|
void dlm_debug_init(struct dlm_ctxt *dlm);
|
|
void dlm_debug_shutdown(struct dlm_ctxt *dlm);
|
|
|
|
int dlm_create_debugfs_subroot(struct dlm_ctxt *dlm);
|
|
void dlm_destroy_debugfs_subroot(struct dlm_ctxt *dlm);
|
|
|
|
void dlm_create_debugfs_root(void);
|
|
void dlm_destroy_debugfs_root(void);
|
|
|
|
#else
|
|
|
|
static inline void dlm_debug_init(struct dlm_ctxt *dlm)
|
|
{
|
|
}
|
|
static inline void dlm_debug_shutdown(struct dlm_ctxt *dlm)
|
|
{
|
|
}
|
|
static inline int dlm_create_debugfs_subroot(struct dlm_ctxt *dlm)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline void dlm_destroy_debugfs_subroot(struct dlm_ctxt *dlm)
|
|
{
|
|
}
|
|
static inline void dlm_create_debugfs_root(void)
|
|
{
|
|
}
|
|
static inline void dlm_destroy_debugfs_root(void)
|
|
{
|
|
}
|
|
|
|
#endif /* CONFIG_DEBUG_FS */
|
|
#endif /* DLMDEBUG_H */
|