All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] fs: cifs: initialize spinlock in data section
@ 2022-09-29  9:06 Zeng Heng
  0 siblings, 0 replies; only message in thread
From: Zeng Heng @ 2022-09-29  9:06 UTC (permalink / raw)
  To: sfrench, pc, lsahlber, sprasad, tom
  Cc: linux-cifs, samba-technical, liwei391, zengheng4

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 --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();
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-29  8:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29  9:06 [PATCH -next] fs: cifs: initialize spinlock in data section Zeng Heng

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.