aboutsummaryrefslogtreecommitdiff
path: root/fs/dlm
diff options
context:
space:
mode:
authorAlexander Aring2021-11-30 14:47:14 -0500
committerDavid Teigland2021-12-07 12:42:26 -0600
commitf70813d6a5fce7bde411272cfe1ab565a4254266 (patch)
tree4d604f722a7d730a910094e5c86903b189ff4001 /fs/dlm
parent1b9beda83e27a0c2cd75d1cb743c297c7b36c844 (diff)
fs: dlm: use list_empty() to check last iteration
This patch will use list_empty(&ls->ls_cb_delay) to check for last list iteration. In case of a multiply count of MAX_CB_QUEUE and the list is empty we do a extra goto more which we can avoid by checking on list_empty(). 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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c
index 27bae7d4a477..bfac462dd3e8 100644
--- a/fs/dlm/ast.c
+++ b/fs/dlm/ast.c
@@ -300,6 +300,7 @@ void dlm_callback_resume(struct dlm_ls *ls)
{
struct dlm_lkb *lkb, *safe;
int count = 0, sum = 0;
+ bool empty;
clear_bit(LSFL_CB_DELAY, &ls->ls_flags);
@@ -315,10 +316,11 @@ more:
if (count == MAX_CB_QUEUE)
break;
}
+ empty = list_empty(&ls->ls_cb_delay);
mutex_unlock(&ls->ls_cb_mutex);
sum += count;
- if (count == MAX_CB_QUEUE) {
+ if (!empty) {
count = 0;
cond_resched();
goto more;