summaryrefslogtreecommitdiffstats
path: root/fs/dlm/lock.c
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2024-03-28 16:48:42 +0100
committerDavid Teigland <teigland@redhat.com>2024-04-01 20:31:13 +0200
commit2bec1bbd55cf96b313566d2e1b9ff54451685e18 (patch)
tree8c8bdabb494e40c06d9f1565f8633e527eb4d3e1 /fs/dlm/lock.c
parentdlm: fix race between final callback and remove (diff)
downloadlinux-2bec1bbd55cf96b313566d2e1b9ff54451685e18.tar.xz
linux-2bec1bbd55cf96b313566d2e1b9ff54451685e18.zip
dlm: remove callback reference counting
Get rid of the unnecessary refcounting on callback structs. Copy interesting callback info into the lkb struct rather than maintaining pointers to callback structs from the lkb. This goes back to the way things were done prior to commit 61bed0baa4db ("fs: dlm: use a non-static queue for callbacks"). Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/lock.c')
-rw-r--r--fs/dlm/lock.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index 198672446dcd..c8426f6f518c 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -1197,7 +1197,9 @@ static int _create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret,
if (!lkb)
return -ENOMEM;
- lkb->lkb_last_bast_mode = -1;
+ lkb->lkb_last_bast_cb_mode = DLM_LOCK_IV;
+ lkb->lkb_last_cast_cb_mode = DLM_LOCK_IV;
+ lkb->lkb_last_cb_mode = DLM_LOCK_IV;
lkb->lkb_nodeid = -1;
lkb->lkb_grmode = DLM_LOCK_IV;
kref_init(&lkb->lkb_ref);
@@ -6031,7 +6033,7 @@ void dlm_clear_proc_locks(struct dlm_ls *ls, struct dlm_user_proc *proc)
list_for_each_entry_safe(cb, cb_safe, &proc->asts, list) {
list_del(&cb->list);
- kref_put(&cb->ref, dlm_release_callback);
+ dlm_free_cb(cb);
}
spin_unlock(&ls->ls_clear_proc_locks);
@@ -6072,7 +6074,7 @@ static void purge_proc_locks(struct dlm_ls *ls, struct dlm_user_proc *proc)
spin_lock(&proc->asts_spin);
list_for_each_entry_safe(cb, cb_safe, &proc->asts, list) {
list_del(&cb->list);
- kref_put(&cb->ref, dlm_release_callback);
+ dlm_free_cb(cb);
}
spin_unlock(&proc->asts_spin);
}