aboutsummaryrefslogtreecommitdiff
path: root/fs/dlm/user.c
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2024-05-28 17:12:34 -0400
committerDavid Teigland <teigland@redhat.com>2024-05-31 11:04:54 -0500
commit4db41bf4f04f75d5bcf52c500cbec11a2e159a06 (patch)
treeb85655c6d3d5d5fa3e79a644b46985e678bfaa2f /fs/dlm/user.c
parentf49da8c09f93ad2b220ee44091123aa9693eefde (diff)
dlm: remove ls_local_handle from struct dlm_ls
This patch removes ls_local_handle from struct dlm_ls as it stores the ls pointer of the top level structure itesef and this isn't necessary. There is a lookup functionality to lookup the lockspace in dlm_find_lockspace_local() but the given input parameter is the pointer already. This might be more safe to lookup a lockspace but given a wrong lockspace pointer is a bug in the code and we save the additional lookup here. The dlm_ls structure can be still hidden by using dlm_lockspace_t handle pointer. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/user.c')
-rw-r--r--fs/dlm/user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 3173b974e8c8..f6635a5314f4 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -454,7 +454,7 @@ static int device_remove_lockspace(struct dlm_lspace_params *params)
if (params->flags & DLM_USER_LSFLG_FORCEFREE)
force = 2;
- lockspace = ls->ls_local_handle;
+ lockspace = ls;
dlm_put_lockspace(ls);
/* The final dlm_release_lockspace waits for references to go to
@@ -657,7 +657,7 @@ static int device_open(struct inode *inode, struct file *file)
return -ENOMEM;
}
- proc->lockspace = ls->ls_local_handle;
+ proc->lockspace = ls;
INIT_LIST_HEAD(&proc->asts);
INIT_LIST_HEAD(&proc->locks);
INIT_LIST_HEAD(&proc->unlocking);