diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-06-27 05:53:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-27 20:32:39 -0400 |
commit | 34af946a22724c4e2b204957f2b24b22a0fb121c (patch) | |
tree | 7881dcbd0a698257c126198cdb6d97d4e45ee51e /net/tipc | |
parent | b6cd0b772dcc5dc9b4c03d53946474dee399fa72 (diff) |
[PATCH] spin/rwlock init cleanups
locking init cleanups:
- convert " = SPIN_LOCK_UNLOCKED" to spin_lock_init() or DEFINE_SPINLOCK()
- convert rwlocks in a similar manner
this patch was generated automatically.
Motivation:
- cleanliness
- lockdep needs control of lock initialization, which the open-coded
variants do not give
- it's also useful for -rt and for lock debugging in general
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/bcast.c | 4 | ||||
-rw-r--r-- | net/tipc/bearer.c | 2 | ||||
-rw-r--r-- | net/tipc/config.c | 2 | ||||
-rw-r--r-- | net/tipc/dbg.c | 2 | ||||
-rw-r--r-- | net/tipc/handler.c | 2 | ||||
-rw-r--r-- | net/tipc/name_table.c | 4 | ||||
-rw-r--r-- | net/tipc/net.c | 2 | ||||
-rw-r--r-- | net/tipc/node.c | 2 | ||||
-rw-r--r-- | net/tipc/port.c | 4 | ||||
-rw-r--r-- | net/tipc/ref.c | 4 | ||||
-rw-r--r-- | net/tipc/subscr.c | 2 | ||||
-rw-r--r-- | net/tipc/user_reg.c | 2 |
12 files changed, 16 insertions, 16 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 54128040a124..1bb75703f384 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -117,7 +117,7 @@ struct bclink { | |||
117 | static struct bcbearer *bcbearer = NULL; | 117 | static struct bcbearer *bcbearer = NULL; |
118 | static struct bclink *bclink = NULL; | 118 | static struct bclink *bclink = NULL; |
119 | static struct link *bcl = NULL; | 119 | static struct link *bcl = NULL; |
120 | static spinlock_t bc_lock = SPIN_LOCK_UNLOCKED; | 120 | static DEFINE_SPINLOCK(bc_lock); |
121 | 121 | ||
122 | char tipc_bclink_name[] = "multicast-link"; | 122 | char tipc_bclink_name[] = "multicast-link"; |
123 | 123 | ||
@@ -796,7 +796,7 @@ int tipc_bclink_init(void) | |||
796 | memset(bclink, 0, sizeof(struct bclink)); | 796 | memset(bclink, 0, sizeof(struct bclink)); |
797 | INIT_LIST_HEAD(&bcl->waiting_ports); | 797 | INIT_LIST_HEAD(&bcl->waiting_ports); |
798 | bcl->next_out_no = 1; | 798 | bcl->next_out_no = 1; |
799 | bclink->node.lock = SPIN_LOCK_UNLOCKED; | 799 | spin_lock_init(&bclink->node.lock); |
800 | bcl->owner = &bclink->node; | 800 | bcl->owner = &bclink->node; |
801 | bcl->max_pkt = MAX_PKT_DEFAULT_MCAST; | 801 | bcl->max_pkt = MAX_PKT_DEFAULT_MCAST; |
802 | tipc_link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT); | 802 | tipc_link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT); |
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 4fa24b5e8914..7ef17a449cfd 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
@@ -566,7 +566,7 @@ restart: | |||
566 | b_ptr->link_req = tipc_disc_init_link_req(b_ptr, &m_ptr->bcast_addr, | 566 | b_ptr->link_req = tipc_disc_init_link_req(b_ptr, &m_ptr->bcast_addr, |
567 | bcast_scope, 2); | 567 | bcast_scope, 2); |
568 | } | 568 | } |
569 | b_ptr->publ.lock = SPIN_LOCK_UNLOCKED; | 569 | spin_lock_init(&b_ptr->publ.lock); |
570 | write_unlock_bh(&tipc_net_lock); | 570 | write_unlock_bh(&tipc_net_lock); |
571 | info("Enabled bearer <%s>, discovery domain %s, priority %u\n", | 571 | info("Enabled bearer <%s>, discovery domain %s, priority %u\n", |
572 | name, addr_string_fill(addr_string, bcast_scope), priority); | 572 | name, addr_string_fill(addr_string, bcast_scope), priority); |
diff --git a/net/tipc/config.c b/net/tipc/config.c index 3ec502fac8c3..285e1bc2d880 100644 --- a/net/tipc/config.c +++ b/net/tipc/config.c | |||
@@ -63,7 +63,7 @@ struct manager { | |||
63 | 63 | ||
64 | static struct manager mng = { 0}; | 64 | static struct manager mng = { 0}; |
65 | 65 | ||
66 | static spinlock_t config_lock = SPIN_LOCK_UNLOCKED; | 66 | static DEFINE_SPINLOCK(config_lock); |
67 | 67 | ||
68 | static const void *req_tlv_area; /* request message TLV area */ | 68 | static const void *req_tlv_area; /* request message TLV area */ |
69 | static int req_tlv_space; /* request message TLV area size */ | 69 | static int req_tlv_space; /* request message TLV area size */ |
diff --git a/net/tipc/dbg.c b/net/tipc/dbg.c index 26ef95d5fe38..55130655e1ed 100644 --- a/net/tipc/dbg.c +++ b/net/tipc/dbg.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #define MAX_STRING 512 | 41 | #define MAX_STRING 512 |
42 | 42 | ||
43 | static char print_string[MAX_STRING]; | 43 | static char print_string[MAX_STRING]; |
44 | static spinlock_t print_lock = SPIN_LOCK_UNLOCKED; | 44 | static DEFINE_SPINLOCK(print_lock); |
45 | 45 | ||
46 | static struct print_buf cons_buf = { NULL, 0, NULL, NULL }; | 46 | static struct print_buf cons_buf = { NULL, 0, NULL, NULL }; |
47 | struct print_buf *TIPC_CONS = &cons_buf; | 47 | struct print_buf *TIPC_CONS = &cons_buf; |
diff --git a/net/tipc/handler.c b/net/tipc/handler.c index 966f70a1b608..ae6ddf00a1aa 100644 --- a/net/tipc/handler.c +++ b/net/tipc/handler.c | |||
@@ -44,7 +44,7 @@ struct queue_item { | |||
44 | 44 | ||
45 | static kmem_cache_t *tipc_queue_item_cache; | 45 | static kmem_cache_t *tipc_queue_item_cache; |
46 | static struct list_head signal_queue_head; | 46 | static struct list_head signal_queue_head; |
47 | static spinlock_t qitem_lock = SPIN_LOCK_UNLOCKED; | 47 | static DEFINE_SPINLOCK(qitem_lock); |
48 | static int handler_enabled = 0; | 48 | static int handler_enabled = 0; |
49 | 49 | ||
50 | static void process_signal_queue(unsigned long dummy); | 50 | static void process_signal_queue(unsigned long dummy); |
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index 38571306aba5..a6926ff07bcc 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c | |||
@@ -101,7 +101,7 @@ struct name_table { | |||
101 | 101 | ||
102 | static struct name_table table = { NULL } ; | 102 | static struct name_table table = { NULL } ; |
103 | static atomic_t rsv_publ_ok = ATOMIC_INIT(0); | 103 | static atomic_t rsv_publ_ok = ATOMIC_INIT(0); |
104 | rwlock_t tipc_nametbl_lock = RW_LOCK_UNLOCKED; | 104 | DEFINE_RWLOCK(tipc_nametbl_lock); |
105 | 105 | ||
106 | 106 | ||
107 | static int hash(int x) | 107 | static int hash(int x) |
@@ -172,7 +172,7 @@ static struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_hea | |||
172 | } | 172 | } |
173 | 173 | ||
174 | memset(nseq, 0, sizeof(*nseq)); | 174 | memset(nseq, 0, sizeof(*nseq)); |
175 | nseq->lock = SPIN_LOCK_UNLOCKED; | 175 | spin_lock_init(&nseq->lock); |
176 | nseq->type = type; | 176 | nseq->type = type; |
177 | nseq->sseqs = sseq; | 177 | nseq->sseqs = sseq; |
178 | dbg("tipc_nameseq_create(): nseq = %p, type %u, ssseqs %p, ff: %u\n", | 178 | dbg("tipc_nameseq_create(): nseq = %p, type %u, ssseqs %p, ff: %u\n", |
diff --git a/net/tipc/net.c b/net/tipc/net.c index f7c8223ddf7d..e5a359ab4930 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
@@ -115,7 +115,7 @@ | |||
115 | * - A local spin_lock protecting the queue of subscriber events. | 115 | * - A local spin_lock protecting the queue of subscriber events. |
116 | */ | 116 | */ |
117 | 117 | ||
118 | rwlock_t tipc_net_lock = RW_LOCK_UNLOCKED; | 118 | DEFINE_RWLOCK(tipc_net_lock); |
119 | struct network tipc_net = { NULL }; | 119 | struct network tipc_net = { NULL }; |
120 | 120 | ||
121 | struct node *tipc_net_select_remote_node(u32 addr, u32 ref) | 121 | struct node *tipc_net_select_remote_node(u32 addr, u32 ref) |
diff --git a/net/tipc/node.c b/net/tipc/node.c index ce9678efa98a..861322b935da 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -77,7 +77,7 @@ struct node *tipc_node_create(u32 addr) | |||
77 | 77 | ||
78 | memset(n_ptr, 0, sizeof(*n_ptr)); | 78 | memset(n_ptr, 0, sizeof(*n_ptr)); |
79 | n_ptr->addr = addr; | 79 | n_ptr->addr = addr; |
80 | n_ptr->lock = SPIN_LOCK_UNLOCKED; | 80 | spin_lock_init(&n_ptr->lock); |
81 | INIT_LIST_HEAD(&n_ptr->nsub); | 81 | INIT_LIST_HEAD(&n_ptr->nsub); |
82 | n_ptr->owner = c_ptr; | 82 | n_ptr->owner = c_ptr; |
83 | tipc_cltr_attach_node(c_ptr, n_ptr); | 83 | tipc_cltr_attach_node(c_ptr, n_ptr); |
diff --git a/net/tipc/port.c b/net/tipc/port.c index 47d97404e3ee..3251c8d8e53c 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c | |||
@@ -57,8 +57,8 @@ | |||
57 | static struct sk_buff *msg_queue_head = NULL; | 57 | static struct sk_buff *msg_queue_head = NULL; |
58 | static struct sk_buff *msg_queue_tail = NULL; | 58 | static struct sk_buff *msg_queue_tail = NULL; |
59 | 59 | ||
60 | spinlock_t tipc_port_list_lock = SPIN_LOCK_UNLOCKED; | 60 | DEFINE_SPINLOCK(tipc_port_list_lock); |
61 | static spinlock_t queue_lock = SPIN_LOCK_UNLOCKED; | 61 | static DEFINE_SPINLOCK(queue_lock); |
62 | 62 | ||
63 | static LIST_HEAD(ports); | 63 | static LIST_HEAD(ports); |
64 | static void port_handle_node_down(unsigned long ref); | 64 | static void port_handle_node_down(unsigned long ref); |
diff --git a/net/tipc/ref.c b/net/tipc/ref.c index d2f0cce10e20..596d3c8ff750 100644 --- a/net/tipc/ref.c +++ b/net/tipc/ref.c | |||
@@ -63,7 +63,7 @@ | |||
63 | 63 | ||
64 | struct ref_table tipc_ref_table = { NULL }; | 64 | struct ref_table tipc_ref_table = { NULL }; |
65 | 65 | ||
66 | static rwlock_t ref_table_lock = RW_LOCK_UNLOCKED; | 66 | static DEFINE_RWLOCK(ref_table_lock); |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * tipc_ref_table_init - create reference table for objects | 69 | * tipc_ref_table_init - create reference table for objects |
@@ -87,7 +87,7 @@ int tipc_ref_table_init(u32 requested_size, u32 start) | |||
87 | index_mask = sz - 1; | 87 | index_mask = sz - 1; |
88 | for (i = sz - 1; i >= 0; i--) { | 88 | for (i = sz - 1; i >= 0; i--) { |
89 | table[i].object = NULL; | 89 | table[i].object = NULL; |
90 | table[i].lock = SPIN_LOCK_UNLOCKED; | 90 | spin_lock_init(&table[i].lock); |
91 | table[i].data.next_plus_upper = (start & ~index_mask) + i - 1; | 91 | table[i].data.next_plus_upper = (start & ~index_mask) + i - 1; |
92 | } | 92 | } |
93 | tipc_ref_table.entries = table; | 93 | tipc_ref_table.entries = table; |
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index fc171875660c..e19b4bcd67ec 100644 --- a/net/tipc/subscr.c +++ b/net/tipc/subscr.c | |||
@@ -457,7 +457,7 @@ int tipc_subscr_start(void) | |||
457 | int res = -1; | 457 | int res = -1; |
458 | 458 | ||
459 | memset(&topsrv, 0, sizeof (topsrv)); | 459 | memset(&topsrv, 0, sizeof (topsrv)); |
460 | topsrv.lock = SPIN_LOCK_UNLOCKED; | 460 | spin_lock_init(&topsrv.lock); |
461 | INIT_LIST_HEAD(&topsrv.subscriber_list); | 461 | INIT_LIST_HEAD(&topsrv.subscriber_list); |
462 | 462 | ||
463 | spin_lock_bh(&topsrv.lock); | 463 | spin_lock_bh(&topsrv.lock); |
diff --git a/net/tipc/user_reg.c b/net/tipc/user_reg.c index 3f3f933976e9..1e3ae57c7228 100644 --- a/net/tipc/user_reg.c +++ b/net/tipc/user_reg.c | |||
@@ -67,7 +67,7 @@ struct tipc_user { | |||
67 | 67 | ||
68 | static struct tipc_user *users = NULL; | 68 | static struct tipc_user *users = NULL; |
69 | static u32 next_free_user = MAX_USERID + 1; | 69 | static u32 next_free_user = MAX_USERID + 1; |
70 | static spinlock_t reg_lock = SPIN_LOCK_UNLOCKED; | 70 | static DEFINE_SPINLOCK(reg_lock); |
71 | 71 | ||
72 | /** | 72 | /** |
73 | * reg_init - create TIPC user registry (but don't activate it) | 73 | * reg_init - create TIPC user registry (but don't activate it) |