Skip to contentSkip to conversation

dlm: use DEFINE_SPINLOCK() for spinlock

PATCH New zhongbaisong 1 participant 1 message Mar 30, 2021 Distributed lock manager (DLM)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dlm: use DEFINE_SPINLOCK() for spinlock

spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init().

---
  fs/dlm/lockspace.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
fs/dlm/lockspace.c +1 -2
index c14cf2b7faab..5bc19cdad34d 100644
@@ -28,7 +28,7 @@
  static int			ls_count;
  static struct mutex		ls_lock;
  static struct list_head		lslist;
-static spinlock_t		lslist_lock;
+static DEFINE_SPINLOCK(lslist_lock);
  static struct task_struct *	scand_task;
  
  
@@ -233,7 +233,6 @@ int __init dlm_lockspace_init(void)
  	ls_count = 0;
  	mutex_init(&ls_lock);
  	INIT_LIST_HEAD(&lslist);
-	spin_lock_init(&lslist_lock);
  
  	dlm_kset = kset_create_and_add("dlm", &dlm_uevent_ops, kernel_kobj);
  	if (!dlm_kset) {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20210330/9ed3c14f/attachment.htm>