Skip to content

Commit

Permalink
fs: dlm: use list_empty() to check last iteration
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Aring authored and David Teigland committed Dec 7, 2021
1 parent 1b9beda commit f70813d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/dlm/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -315,10 +316,11 @@ void dlm_callback_resume(struct dlm_ls *ls)
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;
Expand Down

0 comments on commit f70813d

Please sign in to comment.