Skip to content

Commit 314a554

Browse files
Alexander Aringteigland
authored andcommitted
dlm: move global to static inits
Instead of init global module at module loading time we can move the initialization of those global variables at memory initialization of the module loader. Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent 16d5890 commit 314a554

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

fs/dlm/plock.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
#include "dlm_internal.h"
1414
#include "lockspace.h"
1515

16-
static spinlock_t ops_lock;
17-
static struct list_head send_list;
18-
static struct list_head recv_list;
19-
static wait_queue_head_t send_wq;
20-
static wait_queue_head_t recv_wq;
16+
static DEFINE_SPINLOCK(ops_lock);
17+
static LIST_HEAD(send_list);
18+
static LIST_HEAD(recv_list);
19+
static DECLARE_WAIT_QUEUE_HEAD(send_wq);
20+
static DECLARE_WAIT_QUEUE_HEAD(recv_wq);
2121

2222
struct plock_async_data {
2323
void *fl;
@@ -480,12 +480,6 @@ int dlm_plock_init(void)
480480
{
481481
int rv;
482482

483-
spin_lock_init(&ops_lock);
484-
INIT_LIST_HEAD(&send_list);
485-
INIT_LIST_HEAD(&recv_list);
486-
init_waitqueue_head(&send_wq);
487-
init_waitqueue_head(&recv_wq);
488-
489483
rv = misc_register(&plock_dev_misc);
490484
if (rv)
491485
log_print("dlm_plock_init: misc_register failed %d", rv);

0 commit comments

Comments
 (0)