Commit 964a4eac authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'dlm-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm

Pull dlm updates from David Teigland:
 "This set removes some unnecessary debugfs error handling, and checks
  that lowcomms workqueues are not NULL before destroying"

* tag 'dlm-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
  dlm: no need to check return value of debugfs_create functions
  dlm: check if workqueues are NULL before flushing/destroying
parents 23bbbf5c a48f9721
...@@ -737,7 +737,7 @@ void dlm_delete_debug_file(struct dlm_ls *ls) ...@@ -737,7 +737,7 @@ void dlm_delete_debug_file(struct dlm_ls *ls)
debugfs_remove(ls->ls_debug_toss_dentry); debugfs_remove(ls->ls_debug_toss_dentry);
} }
int dlm_create_debug_file(struct dlm_ls *ls) void dlm_create_debug_file(struct dlm_ls *ls)
{ {
char name[DLM_LOCKSPACE_LEN + 8]; char name[DLM_LOCKSPACE_LEN + 8];
...@@ -748,8 +748,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) ...@@ -748,8 +748,6 @@ int dlm_create_debug_file(struct dlm_ls *ls)
dlm_root, dlm_root,
ls, ls,
&format1_fops); &format1_fops);
if (!ls->ls_debug_rsb_dentry)
goto fail;
/* format 2 */ /* format 2 */
...@@ -761,8 +759,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) ...@@ -761,8 +759,6 @@ int dlm_create_debug_file(struct dlm_ls *ls)
dlm_root, dlm_root,
ls, ls,
&format2_fops); &format2_fops);
if (!ls->ls_debug_locks_dentry)
goto fail;
/* format 3 */ /* format 3 */
...@@ -774,8 +770,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) ...@@ -774,8 +770,6 @@ int dlm_create_debug_file(struct dlm_ls *ls)
dlm_root, dlm_root,
ls, ls,
&format3_fops); &format3_fops);
if (!ls->ls_debug_all_dentry)
goto fail;
/* format 4 */ /* format 4 */
...@@ -787,8 +781,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) ...@@ -787,8 +781,6 @@ int dlm_create_debug_file(struct dlm_ls *ls)
dlm_root, dlm_root,
ls, ls,
&format4_fops); &format4_fops);
if (!ls->ls_debug_toss_dentry)
goto fail;
memset(name, 0, sizeof(name)); memset(name, 0, sizeof(name));
snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name); snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name);
...@@ -798,21 +790,12 @@ int dlm_create_debug_file(struct dlm_ls *ls) ...@@ -798,21 +790,12 @@ int dlm_create_debug_file(struct dlm_ls *ls)
dlm_root, dlm_root,
ls, ls,
&waiters_fops); &waiters_fops);
if (!ls->ls_debug_waiters_dentry)
goto fail;
return 0;
fail:
dlm_delete_debug_file(ls);
return -ENOMEM;
} }
int __init dlm_register_debugfs(void) void __init dlm_register_debugfs(void)
{ {
mutex_init(&debug_buf_lock); mutex_init(&debug_buf_lock);
dlm_root = debugfs_create_dir("dlm", NULL); dlm_root = debugfs_create_dir("dlm", NULL);
return dlm_root ? 0 : -ENOMEM;
} }
void dlm_unregister_debugfs(void) void dlm_unregister_debugfs(void)
......
...@@ -719,14 +719,14 @@ int dlm_plock_init(void); ...@@ -719,14 +719,14 @@ int dlm_plock_init(void);
void dlm_plock_exit(void); void dlm_plock_exit(void);
#ifdef CONFIG_DLM_DEBUG #ifdef CONFIG_DLM_DEBUG
int dlm_register_debugfs(void); void dlm_register_debugfs(void);
void dlm_unregister_debugfs(void); void dlm_unregister_debugfs(void);
int dlm_create_debug_file(struct dlm_ls *ls); void dlm_create_debug_file(struct dlm_ls *ls);
void dlm_delete_debug_file(struct dlm_ls *ls); void dlm_delete_debug_file(struct dlm_ls *ls);
#else #else
static inline int dlm_register_debugfs(void) { return 0; } static inline void dlm_register_debugfs(void) { }
static inline void dlm_unregister_debugfs(void) { } static inline void dlm_unregister_debugfs(void) { }
static inline int dlm_create_debug_file(struct dlm_ls *ls) { return 0; } static inline void dlm_create_debug_file(struct dlm_ls *ls) { }
static inline void dlm_delete_debug_file(struct dlm_ls *ls) { } static inline void dlm_delete_debug_file(struct dlm_ls *ls) { }
#endif #endif
......
...@@ -1628,7 +1628,9 @@ static void clean_writequeues(void) ...@@ -1628,7 +1628,9 @@ static void clean_writequeues(void)
static void work_stop(void) static void work_stop(void)
{ {
if (recv_workqueue)
destroy_workqueue(recv_workqueue); destroy_workqueue(recv_workqueue);
if (send_workqueue)
destroy_workqueue(send_workqueue); destroy_workqueue(send_workqueue);
} }
...@@ -1689,12 +1691,16 @@ static void work_flush(void) ...@@ -1689,12 +1691,16 @@ static void work_flush(void)
struct hlist_node *n; struct hlist_node *n;
struct connection *con; struct connection *con;
if (recv_workqueue)
flush_workqueue(recv_workqueue); flush_workqueue(recv_workqueue);
if (send_workqueue)
flush_workqueue(send_workqueue); flush_workqueue(send_workqueue);
do { do {
ok = 1; ok = 1;
foreach_conn(stop_conn); foreach_conn(stop_conn);
if (recv_workqueue)
flush_workqueue(recv_workqueue); flush_workqueue(recv_workqueue);
if (send_workqueue)
flush_workqueue(send_workqueue); flush_workqueue(send_workqueue);
for (i = 0; i < CONN_HASH_SIZE && ok; i++) { for (i = 0; i < CONN_HASH_SIZE && ok; i++) {
hlist_for_each_entry_safe(con, n, hlist_for_each_entry_safe(con, n,
......
...@@ -35,9 +35,7 @@ static int __init init_dlm(void) ...@@ -35,9 +35,7 @@ static int __init init_dlm(void)
if (error) if (error)
goto out_lockspace; goto out_lockspace;
error = dlm_register_debugfs(); dlm_register_debugfs();
if (error)
goto out_config;
error = dlm_user_init(); error = dlm_user_init();
if (error) if (error)
...@@ -61,7 +59,6 @@ static int __init init_dlm(void) ...@@ -61,7 +59,6 @@ static int __init init_dlm(void)
dlm_user_exit(); dlm_user_exit();
out_debug: out_debug:
dlm_unregister_debugfs(); dlm_unregister_debugfs();
out_config:
dlm_config_exit(); dlm_config_exit();
out_lockspace: out_lockspace:
dlm_lockspace_exit(); dlm_lockspace_exit();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment