]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dlm: convert res_lock to spinlock
authorAlexander Aring <aahringo@redhat.com>
Tue, 2 Apr 2024 19:18:05 +0000 (15:18 -0400)
committerDavid Teigland <teigland@redhat.com>
Tue, 9 Apr 2024 16:44:49 +0000 (11:44 -0500)
Convert the rsb struct res_lock from a mutex to a spinlock
in preparation for processing messages in softirq context.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/dlm_internal.h
fs/dlm/lock.c
fs/dlm/lock.h

index 98029fd5cd2b9564b3082f5f69093faaf56a5722..9f98a815f935560f0b66a3a22cb6bdc0a4676dd7 100644 (file)
@@ -320,7 +320,7 @@ struct dlm_lkb {
 struct dlm_rsb {
        struct dlm_ls           *res_ls;        /* the lockspace */
        struct kref             res_ref;
-       struct mutex            res_mutex;
+       spinlock_t              res_lock;
        unsigned long           res_flags;
        int                     res_length;     /* length of rsb name */
        int                     res_nodeid;
index af677add4f5fce00eb2a7047eb137bcb70facacb..7b309231eebd69ba5452f0eb18d6a6d488a7d011 100644 (file)
@@ -415,7 +415,7 @@ static int get_rsb_struct(struct dlm_ls *ls, const void *name, int len,
        r->res_ls = ls;
        r->res_length = len;
        memcpy(r->res_name, name, len);
-       mutex_init(&r->res_mutex);
+       spin_lock_init(&r->res_lock);
 
        INIT_LIST_HEAD(&r->res_lookup);
        INIT_LIST_HEAD(&r->res_grantqueue);
index b2fd74a2f8eb5712905d4f0d50b70e68165f20d6..0f6b2700c0da652d3fabd8654f03b23184d5e531 100644 (file)
@@ -69,12 +69,12 @@ static inline int is_master(struct dlm_rsb *r)
 
 static inline void lock_rsb(struct dlm_rsb *r)
 {
-       mutex_lock(&r->res_mutex);
+       spin_lock(&r->res_lock);
 }
 
 static inline void unlock_rsb(struct dlm_rsb *r)
 {
-       mutex_unlock(&r->res_mutex);
+       spin_unlock(&r->res_lock);
 }
 
 #endif