diff options
Diffstat (limited to 'fs/ocfs2/stack_user.c')
-rw-r--r-- | fs/ocfs2/stack_user.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 286edf1e231f..4111855a4def 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c | |||
@@ -110,6 +110,8 @@ | |||
110 | struct ocfs2_live_connection { | 110 | struct ocfs2_live_connection { |
111 | struct list_head oc_list; | 111 | struct list_head oc_list; |
112 | struct ocfs2_cluster_connection *oc_conn; | 112 | struct ocfs2_cluster_connection *oc_conn; |
113 | atomic_t oc_this_node; | ||
114 | int oc_our_slot; | ||
113 | }; | 115 | }; |
114 | 116 | ||
115 | struct ocfs2_control_private { | 117 | struct ocfs2_control_private { |
@@ -799,6 +801,42 @@ static int fs_protocol_compare(struct ocfs2_protocol_version *existing, | |||
799 | return 0; | 801 | return 0; |
800 | } | 802 | } |
801 | 803 | ||
804 | static void user_recover_prep(void *arg) | ||
805 | { | ||
806 | } | ||
807 | |||
808 | static void user_recover_slot(void *arg, struct dlm_slot *slot) | ||
809 | { | ||
810 | struct ocfs2_cluster_connection *conn = arg; | ||
811 | printk(KERN_INFO "ocfs2: Node %d/%d down. Initiating recovery.\n", | ||
812 | slot->nodeid, slot->slot); | ||
813 | conn->cc_recovery_handler(slot->nodeid, conn->cc_recovery_data); | ||
814 | |||
815 | } | ||
816 | |||
817 | static void user_recover_done(void *arg, struct dlm_slot *slots, | ||
818 | int num_slots, int our_slot, | ||
819 | uint32_t generation) | ||
820 | { | ||
821 | struct ocfs2_cluster_connection *conn = arg; | ||
822 | struct ocfs2_live_connection *lc = conn->cc_private; | ||
823 | int i; | ||
824 | |||
825 | for (i = 0; i < num_slots; i++) | ||
826 | if (slots[i].slot == our_slot) { | ||
827 | atomic_set(&lc->oc_this_node, slots[i].nodeid); | ||
828 | break; | ||
829 | } | ||
830 | |||
831 | lc->oc_our_slot = our_slot; | ||
832 | } | ||
833 | |||
834 | const struct dlm_lockspace_ops ocfs2_ls_ops = { | ||
835 | .recover_prep = user_recover_prep, | ||
836 | .recover_slot = user_recover_slot, | ||
837 | .recover_done = user_recover_done, | ||
838 | }; | ||
839 | |||
802 | static int user_cluster_connect(struct ocfs2_cluster_connection *conn) | 840 | static int user_cluster_connect(struct ocfs2_cluster_connection *conn) |
803 | { | 841 | { |
804 | dlm_lockspace_t *fsdlm; | 842 | dlm_lockspace_t *fsdlm; |