diff mbox series

[-next] fs: cifs: initialize spinlock in data section

Message ID 20220929090655.2200986-1-zengheng4@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] fs: cifs: initialize spinlock in data section | expand

Commit Message

Zeng Heng Sept. 29, 2022, 9:06 a.m. UTC
Use DEFINE_SPINLOCK to initialize spinlock,
which saves calling spin_lock_init additionally.

There are no logic changes.

Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
 fs/cifs/cifsfs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 8042d7280dec..dda2fe6648fc 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -76,7 +76,7 @@  unsigned int sign_CIFS_PDUs = 1;
 unsigned int GlobalCurrentXid;	/* protected by GlobalMid_Sem */
 unsigned int GlobalTotalActiveXid; /* prot by GlobalMid_Sem */
 unsigned int GlobalMaxActiveXid;	/* prot by GlobalMid_Sem */
-spinlock_t GlobalMid_Lock; /* protects above & list operations on midQ entries */
+DEFINE_SPINLOCK(GlobalMid_Lock); /* protects above & list operations on midQ entries */
 
 /*
  *  Global counters, updated atomically
@@ -96,7 +96,7 @@  atomic_t total_buf_alloc_count;
 atomic_t total_small_buf_alloc_count;
 #endif/* STATS2 */
 struct list_head	cifs_tcp_ses_list;
-spinlock_t		cifs_tcp_ses_lock;
+DEFINE_SPINLOCK(cifs_tcp_ses_lock);
 static const struct super_operations cifs_super_ops;
 unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE;
 module_param(CIFSMaxBufSize, uint, 0444);
@@ -1615,8 +1615,6 @@  init_cifs(void)
 	GlobalCurrentXid = 0;
 	GlobalTotalActiveXid = 0;
 	GlobalMaxActiveXid = 0;
-	spin_lock_init(&cifs_tcp_ses_lock);
-	spin_lock_init(&GlobalMid_Lock);
 
 	cifs_lock_secret = get_random_u32();