From: Huang Guobin <huangguobin4@huawei.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH -next] dlm: use DEFINE_SPINLOCK() for spinlock
Date: Tue, 6 Apr 2021 19:54:07 +0800 [thread overview]
Message-ID: <1617710047-47972-1-git-send-email-huangguobin4@huawei.com> (raw)
From: Guobin Huang <huangguobin4@huawei.com>
spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Guobin Huang <huangguobin4@huawei.com>
---
fs/dlm/plock.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
index c38b2b8ffd1d..5a24a2271fdd 100644
--- a/fs/dlm/plock.c
+++ b/fs/dlm/plock.c
@@ -13,7 +13,7 @@
#include "dlm_internal.h"
#include "lockspace.h"
-static spinlock_t ops_lock;
+static DEFINE_SPINLOCK(ops_lock);
static struct list_head send_list;
static struct list_head recv_list;
static wait_queue_head_t send_wq;
@@ -492,7 +492,6 @@ int dlm_plock_init(void)
{
int rv;
- spin_lock_init(&ops_lock);
INIT_LIST_HEAD(&send_list);
INIT_LIST_HEAD(&recv_list);
init_waitqueue_head(&send_wq);
next reply other threads:[~2021-04-06 11:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 11:54 Huang Guobin [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-03-30 2:00 [Cluster-devel] [PATCH -next] dlm: use DEFINE_SPINLOCK() for spinlock zhongbaisong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1617710047-47972-1-git-send-email-huangguobin4@huawei.com \
--to=huangguobin4@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).