lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 24 Dec 2020 21:22:17 +0800
From:   Zheng Yongjun <zhengyongjun3@...wei.com>
To:     <clm@...com>, <josef@...icpanda.com>, <dsterba@...e.com>,
        <linux-btrfs@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:     Zheng Yongjun <zhengyongjun3@...wei.com>
Subject: [PATCH v2 -next] btrfs: use DEFINE_MUTEX() for mutex lock

mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().

Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
---
 fs/btrfs/check-integrity.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
index 81a8c87a5afb..783e1cad9ae3 100644
--- a/fs/btrfs/check-integrity.c
+++ b/fs/btrfs/check-integrity.c
@@ -371,7 +371,7 @@ static void btrfsic_cmp_log_and_dev_bytenr(struct btrfsic_state *state,
 					   struct btrfsic_dev_state *dev_state,
 					   u64 dev_bytenr);
 
-static struct mutex btrfsic_mutex;
+static DEFINE_MUTEX(btrfsic_mutex);
 static int btrfsic_is_initialized;
 static struct btrfsic_dev_state_hashtable btrfsic_dev_state_hashtable;
 
@@ -2789,7 +2789,6 @@ int btrfsic_mount(struct btrfs_fs_info *fs_info,
 		return -ENOMEM;
 
 	if (!btrfsic_is_initialized) {
-		mutex_init(&btrfsic_mutex);
 		btrfsic_dev_state_hashtable_init(&btrfsic_dev_state_hashtable);
 		btrfsic_is_initialized = 1;
 	}
-- 
2.22.0

Powered by blists - more mailing lists