diff options
author | Alexander Aring <aahringo@redhat.com> | 2022-04-04 23:06:36 +0300 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2022-04-06 22:02:16 +0300 |
commit | 314a5540ffee6cedcfdd6c8439f322282c0e76ae (patch) | |
tree | 11cf3c27bed367d52caa323a45aa48133c4bb5c6 /fs/dlm | |
parent | 16d58904dfeb13cc9758194df99cb1a756f11fbc (diff) |
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 <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r-- | fs/dlm/plock.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index ff439d780cb1..16241fe6ac3c 100644 --- a/fs/dlm/plock.c +++ b/fs/dlm/plock.c @@ -13,11 +13,11 @@ #include "dlm_internal.h" #include "lockspace.h" -static spinlock_t ops_lock; -static struct list_head send_list; -static struct list_head recv_list; -static wait_queue_head_t send_wq; -static wait_queue_head_t recv_wq; +static DEFINE_SPINLOCK(ops_lock); +static LIST_HEAD(send_list); +static LIST_HEAD(recv_list); +static DECLARE_WAIT_QUEUE_HEAD(send_wq); +static DECLARE_WAIT_QUEUE_HEAD(recv_wq); struct plock_async_data { void *fl; @@ -480,12 +480,6 @@ int dlm_plock_init(void) { int rv; - spin_lock_init(&ops_lock); - INIT_LIST_HEAD(&send_list); - INIT_LIST_HEAD(&recv_list); - init_waitqueue_head(&send_wq); - init_waitqueue_head(&recv_wq); - rv = misc_register(&plock_dev_misc); if (rv) log_print("dlm_plock_init: misc_register failed %d", rv); |