diff options
| author | Alexander Aring <aahringo@redhat.com> | 2024-04-15 14:39:36 -0400 |
|---|---|---|
| committer | David Teigland <teigland@redhat.com> | 2024-04-16 13:46:41 -0500 |
| commit | dcdaad05ca15150ae076299ba827867f243c0623 (patch) | |
| tree | 7c2de1b856c210660f70cefa6b9c562d5d9f9318 /fs/dlm/debug_fs.c | |
| parent | 700b04808fad2eac24abf050f234f059199fa3fe (diff) | |
| download | linux-next-dcdaad05ca15150ae076299ba827867f243c0623.tar.gz linux-next-dcdaad05ca15150ae076299ba827867f243c0623.zip | |
dlm: change to single hashtable lock
Prepare to replace our own hash table with rhashtable by replacing
the per-bucket locks in our own hash table with a single lock.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/debug_fs.c')
| -rw-r--r-- | fs/dlm/debug_fs.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c index cba5514688ee..b8234eba5e34 100644 --- a/fs/dlm/debug_fs.c +++ b/fs/dlm/debug_fs.c @@ -452,7 +452,7 @@ static void *table_seq_start(struct seq_file *seq, loff_t *pos) tree = toss ? &ls->ls_rsbtbl[bucket].toss : &ls->ls_rsbtbl[bucket].keep; - spin_lock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_lock_bh(&ls->ls_rsbtbl_lock); if (!RB_EMPTY_ROOT(tree)) { for (node = rb_first(tree); node; node = rb_next(node)) { r = rb_entry(node, struct dlm_rsb, res_hashnode); @@ -460,12 +460,12 @@ static void *table_seq_start(struct seq_file *seq, loff_t *pos) dlm_hold_rsb(r); ri->rsb = r; ri->bucket = bucket; - spin_unlock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_unlock_bh(&ls->ls_rsbtbl_lock); return ri; } } } - spin_unlock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_unlock_bh(&ls->ls_rsbtbl_lock); /* * move to the first rsb in the next non-empty bucket @@ -484,18 +484,18 @@ static void *table_seq_start(struct seq_file *seq, loff_t *pos) } tree = toss ? &ls->ls_rsbtbl[bucket].toss : &ls->ls_rsbtbl[bucket].keep; - spin_lock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_lock_bh(&ls->ls_rsbtbl_lock); if (!RB_EMPTY_ROOT(tree)) { node = rb_first(tree); r = rb_entry(node, struct dlm_rsb, res_hashnode); dlm_hold_rsb(r); ri->rsb = r; ri->bucket = bucket; - spin_unlock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_unlock_bh(&ls->ls_rsbtbl_lock); *pos = n; return ri; } - spin_unlock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_unlock_bh(&ls->ls_rsbtbl_lock); } } @@ -516,7 +516,7 @@ static void *table_seq_next(struct seq_file *seq, void *iter_ptr, loff_t *pos) * move to the next rsb in the same bucket */ - spin_lock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_lock_bh(&ls->ls_rsbtbl_lock); rp = ri->rsb; next = rb_next(&rp->res_hashnode); @@ -524,12 +524,12 @@ static void *table_seq_next(struct seq_file *seq, void *iter_ptr, loff_t *pos) r = rb_entry(next, struct dlm_rsb, res_hashnode); dlm_hold_rsb(r); ri->rsb = r; - spin_unlock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_unlock_bh(&ls->ls_rsbtbl_lock); dlm_put_rsb(rp); ++*pos; return ri; } - spin_unlock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_unlock_bh(&ls->ls_rsbtbl_lock); dlm_put_rsb(rp); /* @@ -550,18 +550,18 @@ static void *table_seq_next(struct seq_file *seq, void *iter_ptr, loff_t *pos) } tree = toss ? &ls->ls_rsbtbl[bucket].toss : &ls->ls_rsbtbl[bucket].keep; - spin_lock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_lock_bh(&ls->ls_rsbtbl_lock); if (!RB_EMPTY_ROOT(tree)) { next = rb_first(tree); r = rb_entry(next, struct dlm_rsb, res_hashnode); dlm_hold_rsb(r); ri->rsb = r; ri->bucket = bucket; - spin_unlock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_unlock_bh(&ls->ls_rsbtbl_lock); *pos = n; return ri; } - spin_unlock_bh(&ls->ls_rsbtbl[bucket].lock); + spin_unlock_bh(&ls->ls_rsbtbl_lock); } } |
