diff options
author | Alexander Aring <aahringo@redhat.com> | 2024-04-15 14:39:37 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2024-04-16 13:49:13 -0500 |
commit | 2d90354027ad2011c0c5a2a404fe81afc745c2a7 (patch) | |
tree | b49e9ac7c7dcff83072a285526bacb90b7b259a2 /fs/dlm/recover.c | |
parent | dcdaad05ca15150ae076299ba827867f243c0623 (diff) |
dlm: merge toss and keep hash table lists into one list
There are several places where lock processing can perform two hash table
lookups, first in the "keep" list, and if not found, in the "toss" list.
This patch introduces a new rsb state flag "RSB_TOSS" to represent the
difference between the state of being on keep vs toss list, so that the
two lists can be combined. This avoids cases of two lookups.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/recover.c')
-rw-r--r-- | fs/dlm/recover.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/dlm/recover.c b/fs/dlm/recover.c index 9a4c8e4b2442..e53d88e4ec93 100644 --- a/fs/dlm/recover.c +++ b/fs/dlm/recover.c @@ -888,10 +888,13 @@ void dlm_clear_toss(struct dlm_ls *ls) spin_lock(&ls->ls_rsbtbl_lock); for (i = 0; i < ls->ls_rsbtbl_size; i++) { - for (n = rb_first(&ls->ls_rsbtbl[i].toss); n; n = next) { + for (n = rb_first(&ls->ls_rsbtbl[i].r); n; n = next) { next = rb_next(n); r = rb_entry(n, struct dlm_rsb, res_hashnode); - rb_erase(n, &ls->ls_rsbtbl[i].toss); + if (!rsb_flag(r, RSB_TOSS)) + continue; + + rb_erase(n, &ls->ls_rsbtbl[i].r); dlm_free_rsb(r); count++; } |