fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / afs / server.c
index e94628c..44aff81 100644 (file)
@@ -55,13 +55,12 @@ int afs_server_lookup(struct afs_cell *cell, const struct in_addr *addr,
        _enter("%p,%08x,", cell, ntohl(addr->s_addr));
 
        /* allocate and initialise a server record */
-       server = kmalloc(sizeof(struct afs_server), GFP_KERNEL);
+       server = kzalloc(sizeof(struct afs_server), GFP_KERNEL);
        if (!server) {
                _leave(" = -ENOMEM");
                return -ENOMEM;
        }
 
-       memset(server, 0, sizeof(struct afs_server));
        atomic_set(&server->usage, 1);
 
        INIT_LIST_HEAD(&server->link);
@@ -375,6 +374,7 @@ int afs_server_request_callslot(struct afs_server *server,
        else if (list_empty(&server->fs_callq)) {
                /* no one waiting */
                server->fs_conn_cnt[nconn]++;
+               spin_unlock(&server->fs_lock);
        }
        else {
                /* someone's waiting - dequeue them and wake them up */
@@ -392,9 +392,9 @@ int afs_server_request_callslot(struct afs_server *server,
                }
                pcallslot->ready = 1;
                wake_up_process(pcallslot->task);
+               spin_unlock(&server->fs_lock);
        }
 
-       spin_unlock(&server->fs_lock);
        rxrpc_put_connection(callslot->conn);
        callslot->conn = NULL;