diff options
-rw-r--r-- | fs/dlm/debug_fs.c | 21 | ||||
-rw-r--r-- | fs/dlm/dlm_internal.h | 8 | ||||
-rw-r--r-- | fs/dlm/lowcomms.c | 18 | ||||
-rw-r--r-- | fs/dlm/main.c | 5 |
4 files changed, 19 insertions, 33 deletions
diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c index 0e941d42e3e9..d6bbccb0ed15 100644 --- a/fs/dlm/debug_fs.c +++ b/fs/dlm/debug_fs.c | |||
@@ -737,7 +737,7 @@ void dlm_delete_debug_file(struct dlm_ls *ls) | |||
737 | debugfs_remove(ls->ls_debug_toss_dentry); | 737 | debugfs_remove(ls->ls_debug_toss_dentry); |
738 | } | 738 | } |
739 | 739 | ||
740 | int dlm_create_debug_file(struct dlm_ls *ls) | 740 | void dlm_create_debug_file(struct dlm_ls *ls) |
741 | { | 741 | { |
742 | char name[DLM_LOCKSPACE_LEN + 8]; | 742 | char name[DLM_LOCKSPACE_LEN + 8]; |
743 | 743 | ||
@@ -748,8 +748,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) | |||
748 | dlm_root, | 748 | dlm_root, |
749 | ls, | 749 | ls, |
750 | &format1_fops); | 750 | &format1_fops); |
751 | if (!ls->ls_debug_rsb_dentry) | ||
752 | goto fail; | ||
753 | 751 | ||
754 | /* format 2 */ | 752 | /* format 2 */ |
755 | 753 | ||
@@ -761,8 +759,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) | |||
761 | dlm_root, | 759 | dlm_root, |
762 | ls, | 760 | ls, |
763 | &format2_fops); | 761 | &format2_fops); |
764 | if (!ls->ls_debug_locks_dentry) | ||
765 | goto fail; | ||
766 | 762 | ||
767 | /* format 3 */ | 763 | /* format 3 */ |
768 | 764 | ||
@@ -774,8 +770,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) | |||
774 | dlm_root, | 770 | dlm_root, |
775 | ls, | 771 | ls, |
776 | &format3_fops); | 772 | &format3_fops); |
777 | if (!ls->ls_debug_all_dentry) | ||
778 | goto fail; | ||
779 | 773 | ||
780 | /* format 4 */ | 774 | /* format 4 */ |
781 | 775 | ||
@@ -787,8 +781,6 @@ int dlm_create_debug_file(struct dlm_ls *ls) | |||
787 | dlm_root, | 781 | dlm_root, |
788 | ls, | 782 | ls, |
789 | &format4_fops); | 783 | &format4_fops); |
790 | if (!ls->ls_debug_toss_dentry) | ||
791 | goto fail; | ||
792 | 784 | ||
793 | memset(name, 0, sizeof(name)); | 785 | memset(name, 0, sizeof(name)); |
794 | snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name); | 786 | 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 | dlm_root, | 790 | dlm_root, |
799 | ls, | 791 | ls, |
800 | &waiters_fops); | 792 | &waiters_fops); |
801 | if (!ls->ls_debug_waiters_dentry) | ||
802 | goto fail; | ||
803 | |||
804 | return 0; | ||
805 | |||
806 | fail: | ||
807 | dlm_delete_debug_file(ls); | ||
808 | return -ENOMEM; | ||
809 | } | 793 | } |
810 | 794 | ||
811 | int __init dlm_register_debugfs(void) | 795 | void __init dlm_register_debugfs(void) |
812 | { | 796 | { |
813 | mutex_init(&debug_buf_lock); | 797 | mutex_init(&debug_buf_lock); |
814 | dlm_root = debugfs_create_dir("dlm", NULL); | 798 | dlm_root = debugfs_create_dir("dlm", NULL); |
815 | return dlm_root ? 0 : -ENOMEM; | ||
816 | } | 799 | } |
817 | 800 | ||
818 | void dlm_unregister_debugfs(void) | 801 | void dlm_unregister_debugfs(void) |
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h index da1173a0b274..416d9de35679 100644 --- a/fs/dlm/dlm_internal.h +++ b/fs/dlm/dlm_internal.h | |||
@@ -719,14 +719,14 @@ int dlm_plock_init(void); | |||
719 | void dlm_plock_exit(void); | 719 | void dlm_plock_exit(void); |
720 | 720 | ||
721 | #ifdef CONFIG_DLM_DEBUG | 721 | #ifdef CONFIG_DLM_DEBUG |
722 | int dlm_register_debugfs(void); | 722 | void dlm_register_debugfs(void); |
723 | void dlm_unregister_debugfs(void); | 723 | void dlm_unregister_debugfs(void); |
724 | int dlm_create_debug_file(struct dlm_ls *ls); | 724 | void dlm_create_debug_file(struct dlm_ls *ls); |
725 | void dlm_delete_debug_file(struct dlm_ls *ls); | 725 | void dlm_delete_debug_file(struct dlm_ls *ls); |
726 | #else | 726 | #else |
727 | static inline int dlm_register_debugfs(void) { return 0; } | 727 | static inline void dlm_register_debugfs(void) { } |
728 | static inline void dlm_unregister_debugfs(void) { } | 728 | static inline void dlm_unregister_debugfs(void) { } |
729 | static inline int dlm_create_debug_file(struct dlm_ls *ls) { return 0; } | 729 | static inline void dlm_create_debug_file(struct dlm_ls *ls) { } |
730 | static inline void dlm_delete_debug_file(struct dlm_ls *ls) { } | 730 | static inline void dlm_delete_debug_file(struct dlm_ls *ls) { } |
731 | #endif | 731 | #endif |
732 | 732 | ||
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 114ebfe30929..3951d39b9b75 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c | |||
@@ -1628,8 +1628,10 @@ static void clean_writequeues(void) | |||
1628 | 1628 | ||
1629 | static void work_stop(void) | 1629 | static void work_stop(void) |
1630 | { | 1630 | { |
1631 | destroy_workqueue(recv_workqueue); | 1631 | if (recv_workqueue) |
1632 | destroy_workqueue(send_workqueue); | 1632 | destroy_workqueue(recv_workqueue); |
1633 | if (send_workqueue) | ||
1634 | destroy_workqueue(send_workqueue); | ||
1633 | } | 1635 | } |
1634 | 1636 | ||
1635 | static int work_start(void) | 1637 | static int work_start(void) |
@@ -1689,13 +1691,17 @@ static void work_flush(void) | |||
1689 | struct hlist_node *n; | 1691 | struct hlist_node *n; |
1690 | struct connection *con; | 1692 | struct connection *con; |
1691 | 1693 | ||
1692 | flush_workqueue(recv_workqueue); | 1694 | if (recv_workqueue) |
1693 | flush_workqueue(send_workqueue); | 1695 | flush_workqueue(recv_workqueue); |
1696 | if (send_workqueue) | ||
1697 | flush_workqueue(send_workqueue); | ||
1694 | do { | 1698 | do { |
1695 | ok = 1; | 1699 | ok = 1; |
1696 | foreach_conn(stop_conn); | 1700 | foreach_conn(stop_conn); |
1697 | flush_workqueue(recv_workqueue); | 1701 | if (recv_workqueue) |
1698 | flush_workqueue(send_workqueue); | 1702 | flush_workqueue(recv_workqueue); |
1703 | if (send_workqueue) | ||
1704 | flush_workqueue(send_workqueue); | ||
1699 | for (i = 0; i < CONN_HASH_SIZE && ok; i++) { | 1705 | for (i = 0; i < CONN_HASH_SIZE && ok; i++) { |
1700 | hlist_for_each_entry_safe(con, n, | 1706 | hlist_for_each_entry_safe(con, n, |
1701 | &connection_hash[i], list) { | 1707 | &connection_hash[i], list) { |
diff --git a/fs/dlm/main.c b/fs/dlm/main.c index 39579927ed84..afc66a1346d3 100644 --- a/fs/dlm/main.c +++ b/fs/dlm/main.c | |||
@@ -35,9 +35,7 @@ static int __init init_dlm(void) | |||
35 | if (error) | 35 | if (error) |
36 | goto out_lockspace; | 36 | goto out_lockspace; |
37 | 37 | ||
38 | error = dlm_register_debugfs(); | 38 | dlm_register_debugfs(); |
39 | if (error) | ||
40 | goto out_config; | ||
41 | 39 | ||
42 | error = dlm_user_init(); | 40 | error = dlm_user_init(); |
43 | if (error) | 41 | if (error) |
@@ -61,7 +59,6 @@ static int __init init_dlm(void) | |||
61 | dlm_user_exit(); | 59 | dlm_user_exit(); |
62 | out_debug: | 60 | out_debug: |
63 | dlm_unregister_debugfs(); | 61 | dlm_unregister_debugfs(); |
64 | out_config: | ||
65 | dlm_config_exit(); | 62 | dlm_config_exit(); |
66 | out_lockspace: | 63 | out_lockspace: |
67 | dlm_lockspace_exit(); | 64 | dlm_lockspace_exit(); |