Skip to content

Commit cc396e2

Browse files
Alexander Aringteigland
authored andcommitted
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 <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent 097691d commit cc396e2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

fs/dlm/dlm_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ struct dlm_lkb {
320320
struct dlm_rsb {
321321
struct dlm_ls *res_ls; /* the lockspace */
322322
struct kref res_ref;
323-
struct mutex res_mutex;
323+
spinlock_t res_lock;
324324
unsigned long res_flags;
325325
int res_length; /* length of rsb name */
326326
int res_nodeid;

fs/dlm/lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static int get_rsb_struct(struct dlm_ls *ls, const void *name, int len,
415415
r->res_ls = ls;
416416
r->res_length = len;
417417
memcpy(r->res_name, name, len);
418-
mutex_init(&r->res_mutex);
418+
spin_lock_init(&r->res_lock);
419419

420420
INIT_LIST_HEAD(&r->res_lookup);
421421
INIT_LIST_HEAD(&r->res_grantqueue);

fs/dlm/lock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ static inline int is_master(struct dlm_rsb *r)
6969

7070
static inline void lock_rsb(struct dlm_rsb *r)
7171
{
72-
mutex_lock(&r->res_mutex);
72+
spin_lock(&r->res_lock);
7373
}
7474

7575
static inline void unlock_rsb(struct dlm_rsb *r)
7676
{
77-
mutex_unlock(&r->res_mutex);
77+
spin_unlock(&r->res_lock);
7878
}
7979

8080
#endif

0 commit comments

Comments
 (0)