scoutfs: provide a function to init and uninit our dlmglue context

Signed-off-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
Mark Fasheh
2017-08-23 22:28:37 -05:00
parent 4fb011ca71
commit 6308f347c0
2 changed files with 24 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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);