* [PATCH v2 -next] dlm: use DEFINE_MUTEX() for mutex lock
@ 2020-12-24 13:22 ` Zheng Yongjun
0 siblings, 0 replies; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-24 13:22 UTC (permalink / raw)
To: cluster-devel, linux-kernel; +Cc: ccaulfie, teigland, Zheng Yongjun
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
fs/dlm/lockspace.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 624617c12250..2b3c32f2d29d 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -26,7 +26,7 @@
#include "ast.h"
static int ls_count;
-static struct mutex ls_lock;
+static DEFINE_MUTEX(ls_lock);
static struct list_head lslist;
static spinlock_t lslist_lock;
static struct task_struct * scand_task;
@@ -231,7 +231,6 @@ static const struct kset_uevent_ops dlm_uevent_ops = {
int __init dlm_lockspace_init(void)
{
ls_count = 0;
- mutex_init(&ls_lock);
INIT_LIST_HEAD(&lslist);
spin_lock_init(&lslist_lock);
--
2.22.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH v2 -next] dlm: use DEFINE_MUTEX() for mutex lock
@ 2020-12-24 13:22 ` Zheng Yongjun
0 siblings, 0 replies; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-24 13:22 UTC (permalink / raw)
To: cluster-devel.redhat.com
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
fs/dlm/lockspace.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 624617c12250..2b3c32f2d29d 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -26,7 +26,7 @@
#include "ast.h"
static int ls_count;
-static struct mutex ls_lock;
+static DEFINE_MUTEX(ls_lock);
static struct list_head lslist;
static spinlock_t lslist_lock;
static struct task_struct * scand_task;
@@ -231,7 +231,6 @@ static const struct kset_uevent_ops dlm_uevent_ops = {
int __init dlm_lockspace_init(void)
{
ls_count = 0;
- mutex_init(&ls_lock);
INIT_LIST_HEAD(&lslist);
spin_lock_init(&lslist_lock);
--
2.22.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-24 13:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24 13:22 [PATCH v2 -next] dlm: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
2020-12-24 13:22 ` [Cluster-devel] " Zheng Yongjun
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.