Commit 0175e51b authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland

dlm: combine switch case fail and default statements

This patch combines the failure and default cases for enqueue and
dequeue a callback to the lkb callback queue that should end in both
cases as it should never happen.
Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent 4ed42428
...@@ -160,11 +160,10 @@ void dlm_add_cb(struct dlm_lkb *lkb, uint32_t flags, int mode, int status, ...@@ -160,11 +160,10 @@ void dlm_add_cb(struct dlm_lkb *lkb, uint32_t flags, int mode, int status,
} }
spin_unlock(&ls->ls_cb_lock); spin_unlock(&ls->ls_cb_lock);
break; break;
case DLM_ENQUEUE_CALLBACK_FAILURE:
WARN_ON_ONCE(1);
break;
case DLM_ENQUEUE_CALLBACK_SUCCESS: case DLM_ENQUEUE_CALLBACK_SUCCESS:
break; break;
case DLM_ENQUEUE_CALLBACK_FAILURE:
fallthrough;
default: default:
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
break; break;
......
...@@ -231,10 +231,6 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode, ...@@ -231,10 +231,6 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode,
rv = dlm_enqueue_lkb_callback(lkb, flags, mode, status, sbflags); rv = dlm_enqueue_lkb_callback(lkb, flags, mode, status, sbflags);
switch (rv) { switch (rv) {
case DLM_ENQUEUE_CALLBACK_FAILURE:
spin_unlock(&proc->asts_spin);
WARN_ON_ONCE(1);
goto out;
case DLM_ENQUEUE_CALLBACK_NEED_SCHED: case DLM_ENQUEUE_CALLBACK_NEED_SCHED:
kref_get(&lkb->lkb_ref); kref_get(&lkb->lkb_ref);
list_add_tail(&lkb->lkb_cb_list, &proc->asts); list_add_tail(&lkb->lkb_cb_list, &proc->asts);
...@@ -242,9 +238,12 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode, ...@@ -242,9 +238,12 @@ void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode,
break; break;
case DLM_ENQUEUE_CALLBACK_SUCCESS: case DLM_ENQUEUE_CALLBACK_SUCCESS:
break; break;
case DLM_ENQUEUE_CALLBACK_FAILURE:
fallthrough;
default: default:
spin_unlock(&proc->asts_spin);
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
break; goto out;
} }
spin_unlock(&proc->asts_spin); spin_unlock(&proc->asts_spin);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment