summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2024-04-02 15:18:05 -0400
committerDavid Teigland <teigland@redhat.com>2024-04-09 11:44:49 -0500
commitcc396e2355b5ca6e1aee005f3ce99bab8f37f5ff (patch)
treed1a5e2c16c95a0ee30e1575ce8f264d2a101d191 /fs
parent097691dbadcdcaa6428adf0417cd227602eb60a4 (diff)
downloadlinux-stable-cc396e2355b5ca6e1aee005f3ce99bab8f37f5ff.tar.gz
linux-stable-cc396e2355b5ca6e1aee005f3ce99bab8f37f5ff.tar.bz2
linux-stable-cc396e2355b5ca6e1aee005f3ce99bab8f37f5ff.zip
dlm: convert res_lock to spinlock
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/dlm/dlm_internal.h2
-rw-r--r--fs/dlm/lock.c2
-rw-r--r--fs/dlm/lock.h4
3 files changed, 4 insertions, 4 deletions
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
index 98029fd5cd2b..9f98a815f935 100644
--- a/fs/dlm/dlm_internal.h
+++ b/fs/dlm/dlm_internal.h
@@ -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;
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c
index af677add4f5f..7b309231eebd 100644
--- a/fs/dlm/lock.c
+++ b/fs/dlm/lock.c
@@ -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);
diff --git a/fs/dlm/lock.h b/fs/dlm/lock.h
index b2fd74a2f8eb..0f6b2700c0da 100644
--- a/fs/dlm/lock.h
+++ b/fs/dlm/lock.h
@@ -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