summaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2024-03-28 16:48:40 +0100
committerDavid Teigland <teigland@redhat.com>2024-04-01 20:31:12 +0200
commit0175e51b5134b55c89364aae68ec16271c67e472 (patch)
treee66772705d2634eb6cf6450a8fd896cc029bcbcd /fs/dlm
parentdlm: save callback debug info earlier (diff)
downloadlinux-0175e51b5134b55c89364aae68ec16271c67e472.tar.xz
linux-0175e51b5134b55c89364aae68ec16271c67e472.zip
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: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/ast.c5
-rw-r--r--fs/dlm/user.c9
2 files changed, 6 insertions, 8 deletions
diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c
index cadbcbe0786b..5ea0b62f276b 100644
--- a/fs/dlm/ast.c
+++ b/fs/dlm/ast.c
@@ -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);
break;
- case DLM_ENQUEUE_CALLBACK_FAILURE:
- WARN_ON_ONCE(1);
- break;
case DLM_ENQUEUE_CALLBACK_SUCCESS:
break;
+ case DLM_ENQUEUE_CALLBACK_FAILURE:
+ fallthrough;
default:
WARN_ON_ONCE(1);
break;
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 6f99bbeeac9b..fa99b6074e5c 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -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);
switch (rv) {
- case DLM_ENQUEUE_CALLBACK_FAILURE:
- spin_unlock(&proc->asts_spin);
- WARN_ON_ONCE(1);
- goto out;
case DLM_ENQUEUE_CALLBACK_NEED_SCHED:
kref_get(&lkb->lkb_ref);
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,
break;
case DLM_ENQUEUE_CALLBACK_SUCCESS:
break;
+ case DLM_ENQUEUE_CALLBACK_FAILURE:
+ fallthrough;
default:
+ spin_unlock(&proc->asts_spin);
WARN_ON_ONCE(1);
- break;
+ goto out;
}
spin_unlock(&proc->asts_spin);