]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
fixed mount waiting
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 2 Dec 2007 21:22:40 +0000 (21:22 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Sun, 2 Dec 2007 21:22:40 +0000 (21:22 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@2170 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/kernel/client.c
trunk/ceph/kernel/client.h

index 7cc05e0c028126598a737557b3501c82c5d2ece5..49181b39fd21dfbcae63a9e3d49a5c07325c4a29 100644 (file)
@@ -61,7 +61,7 @@ static struct ceph_client *create_client(struct ceph_mount_args *args)
                return ERR_PTR(-ENOMEM);
 
        atomic_set(&cl->nref, 0);
-       init_waitqueue_head(&cl->mount_wq);
+       init_completion(&cl->mount_completion);
        spin_lock_init(&cl->sb_lock);
        get_client_counter();
 
@@ -116,9 +116,7 @@ trymount:
 
        /* wait */
        dout(10, "mount waiting\n");
-       err = wait_event_interruptible_timeout(client->mount_wq, 
-                                              (find_first_zero_bit(&client->mounting, 4) == 3),
-                                              6*HZ);
+       err = wait_for_completion_timeout(&client->mount_completion, 6*HZ);
        if (err == -EINTR)
                return err; 
        if (client->mounting < 7) {
@@ -129,7 +127,7 @@ trymount:
        }
 
        /* get handle for mount path */
-       dout(10, "mount got all maps; opening root directory\n");
+       dout(10, "mount got all maps; opening root directory '%s'\n", args->path);
        err = ceph_mdsc_do(&client->mdsc, CEPH_MDS_OP_OPEN,
                           CEPH_INO_ROOT, args->path, 0, 0);
        if (err < 0)
@@ -229,7 +227,7 @@ void got_first_map(struct ceph_client *client, int num)
             num, client->mounting, (int)find_first_zero_bit(&client->mounting, 4));
        if (find_first_zero_bit(&client->mounting, 4) == 3) {
                dout(10, "got_first_map kicking mount\n");
-               wake_up(&client->mount_wq);
+               complete(&client->mount_completion);
        }
 }
 
index 9c2b02c9dd92086715f29c39cf107a49e39df0e7..78abde72ec92d1b14654ee5e2b7df4830bccdfe1 100644 (file)
@@ -40,7 +40,7 @@ struct ceph_client {
        atomic_t nref;
 
        unsigned long mounting;   /* map bitset; 4=mon, 2=mds, 1=osd map */
-       wait_queue_head_t mount_wq;
+       struct completion mount_completion;
 
        struct ceph_messenger *msgr;   /* messenger instance */
        struct ceph_mon_client monc;