diff --git a/kmod/src/dlmglue.c b/kmod/src/dlmglue.c index cbeab58e..e41d346a 100644 --- a/kmod/src/dlmglue.c +++ b/kmod/src/dlmglue.c @@ -4279,3 +4279,24 @@ void ocfs2_wake_downconvert_thread(struct ocfs2_super *osb) spin_unlock_irqrestore(&osb->dc_task_lock, flags); wake_up(&osb->dc_event); } + +int ocfs2_init_super(struct ocfs2_super *osb, int flags) +{ + memset(osb, 0, sizeof(*osb)); + + osb->osb_dlm_debug = ocfs2_new_dlm_debug(); + if (!osb->osb_dlm_debug) + return -ENOMEM; + + spin_lock_init(&osb->dc_task_lock); + init_waitqueue_head(&osb->dc_event); + INIT_LIST_HEAD(&osb->blocked_lock_list); + osb->s_mount_opt = flags; + + return 0; +} + +void ocfs2_uninit_super(struct ocfs2_super *osb) +{ + ocfs2_dlm_shutdown_debug(osb); +} diff --git a/kmod/src/dlmglue.h b/kmod/src/dlmglue.h index b81c65e4..3e25c8c5 100644 --- a/kmod/src/dlmglue.h +++ b/kmod/src/dlmglue.h @@ -246,6 +246,9 @@ int ocfs2_cluster_lock(struct ocfs2_super *osb, struct ocfs2_lock_res *lockres, void ocfs2_cluster_unlock(struct ocfs2_super *osb, struct ocfs2_lock_res *lockres, int level); +int ocfs2_init_super(struct ocfs2_super *osb, int flags); +void ocfs2_uninit_super(struct ocfs2_super *osb); + int ocfs2_dlm_init(struct ocfs2_super *osb, char *cluster_stack, char *cluster_name, char *ls_name, struct dentry *debug_root); void ocfs2_dlm_shutdown(struct ocfs2_super *osb, int hangup_pending);