diff options
Diffstat (limited to 'fs/ocfs2/cluster/nodemanager.c')
-rw-r--r-- | fs/ocfs2/cluster/nodemanager.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c index 9f5ad0f01ce0..af2070da308b 100644 --- a/fs/ocfs2/cluster/nodemanager.c +++ b/fs/ocfs2/cluster/nodemanager.c | |||
@@ -900,6 +900,46 @@ static struct o2nm_cluster_group o2nm_cluster_group = { | |||
900 | }, | 900 | }, |
901 | }; | 901 | }; |
902 | 902 | ||
903 | int o2nm_depend_item(struct config_item *item) | ||
904 | { | ||
905 | return configfs_depend_item(&o2nm_cluster_group.cs_subsys, item); | ||
906 | } | ||
907 | |||
908 | void o2nm_undepend_item(struct config_item *item) | ||
909 | { | ||
910 | configfs_undepend_item(&o2nm_cluster_group.cs_subsys, item); | ||
911 | } | ||
912 | |||
913 | int o2nm_depend_this_node(void) | ||
914 | { | ||
915 | int ret = 0; | ||
916 | struct o2nm_node *local_node; | ||
917 | |||
918 | local_node = o2nm_get_node_by_num(o2nm_this_node()); | ||
919 | if (!local_node) { | ||
920 | ret = -EINVAL; | ||
921 | goto out; | ||
922 | } | ||
923 | |||
924 | ret = o2nm_depend_item(&local_node->nd_item); | ||
925 | o2nm_node_put(local_node); | ||
926 | |||
927 | out: | ||
928 | return ret; | ||
929 | } | ||
930 | |||
931 | void o2nm_undepend_this_node(void) | ||
932 | { | ||
933 | struct o2nm_node *local_node; | ||
934 | |||
935 | local_node = o2nm_get_node_by_num(o2nm_this_node()); | ||
936 | BUG_ON(!local_node); | ||
937 | |||
938 | o2nm_undepend_item(&local_node->nd_item); | ||
939 | o2nm_node_put(local_node); | ||
940 | } | ||
941 | |||
942 | |||
903 | static void __exit exit_o2nm(void) | 943 | static void __exit exit_o2nm(void) |
904 | { | 944 | { |
905 | if (ocfs2_table_header) | 945 | if (ocfs2_table_header) |
@@ -934,7 +974,7 @@ static int __init init_o2nm(void) | |||
934 | goto out_sysctl; | 974 | goto out_sysctl; |
935 | 975 | ||
936 | config_group_init(&o2nm_cluster_group.cs_subsys.su_group); | 976 | config_group_init(&o2nm_cluster_group.cs_subsys.su_group); |
937 | init_MUTEX(&o2nm_cluster_group.cs_subsys.su_sem); | 977 | mutex_init(&o2nm_cluster_group.cs_subsys.su_mutex); |
938 | ret = configfs_register_subsystem(&o2nm_cluster_group.cs_subsys); | 978 | ret = configfs_register_subsystem(&o2nm_cluster_group.cs_subsys); |
939 | if (ret) { | 979 | if (ret) { |
940 | printk(KERN_ERR "nodemanager: Registration returned %d\n", ret); | 980 | printk(KERN_ERR "nodemanager: Registration returned %d\n", ret); |