aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster/nodemanager.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/cluster/nodemanager.c')
-rw-r--r--fs/ocfs2/cluster/nodemanager.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c
index eab46d8a7c8c..af2070da308b 100644
--- a/fs/ocfs2/cluster/nodemanager.c
+++ b/fs/ocfs2/cluster/nodemanager.c
@@ -910,6 +910,36 @@ void o2nm_undepend_item(struct config_item *item)
910 configfs_undepend_item(&o2nm_cluster_group.cs_subsys, item); 910 configfs_undepend_item(&o2nm_cluster_group.cs_subsys, item);
911} 911}
912 912
913int 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
927out:
928 return ret;
929}
930
931void 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
913static void __exit exit_o2nm(void) 943static void __exit exit_o2nm(void)
914{ 944{
915 if (ocfs2_table_header) 945 if (ocfs2_table_header)