]> err.no Git - linux-2.6/blobdiff - net/tipc/name_table.c
[PATCH] spin/rwlock init cleanups
[linux-2.6] / net / tipc / name_table.c
index e90dc80cd74a0ae8920c7138a475ab4eb7d19233..a6926ff07bcc3e2365d0424e30b721df1e455d21 100644 (file)
@@ -101,7 +101,7 @@ struct name_table {
 
 static struct name_table table = { NULL } ;
 static atomic_t rsv_publ_ok = ATOMIC_INIT(0);
-rwlock_t tipc_nametbl_lock = RW_LOCK_UNLOCKED;
+DEFINE_RWLOCK(tipc_nametbl_lock);
 
 
 static int hash(int x)
@@ -120,7 +120,7 @@ static struct publication *publ_create(u32 type, u32 lower, u32 upper,
        struct publication *publ =
                (struct publication *)kmalloc(sizeof(*publ), GFP_ATOMIC);
        if (publ == NULL) {
-               warn("Memory squeeze; failed to create publication\n");
+               warn("Publication creation failure, no memory\n");
                return NULL;
        }
 
@@ -165,14 +165,14 @@ static struct name_seq *tipc_nameseq_create(u32 type, struct hlist_head *seq_hea
        struct sub_seq *sseq = tipc_subseq_alloc(1);
 
        if (!nseq || !sseq) {
-               warn("Memory squeeze; failed to create name sequence\n");
+               warn("Name sequence creation failed, no memory\n");
                kfree(nseq);
                kfree(sseq);
                return NULL;
        }
 
        memset(nseq, 0, sizeof(*nseq));
-       nseq->lock = SPIN_LOCK_UNLOCKED;
+       spin_lock_init(&nseq->lock);
        nseq->type = type;
        nseq->sseqs = sseq;
        dbg("tipc_nameseq_create(): nseq = %p, type %u, ssseqs %p, ff: %u\n",
@@ -759,7 +759,7 @@ struct publication *tipc_nametbl_publish(u32 type, u32 lower, u32 upper,
        struct publication *publ;
 
        if (table.local_publ_count >= tipc_max_publications) {
-               warn("Failed publish: max %u local publication\n", 
+               warn("Publication failed, local publication limit reached (%u)\n", 
                     tipc_max_publications);
                return NULL;
        }