From 34cea8037190b6e23915ccb0f51cfccdd8bfabd1 Mon Sep 17 00:00:00 2001 From: sageweil Date: Sun, 2 Dec 2007 21:22:40 +0000 Subject: [PATCH] fixed mount waiting git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@2170 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/kernel/client.c | 10 ++++------ trunk/ceph/kernel/client.h | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/trunk/ceph/kernel/client.c b/trunk/ceph/kernel/client.c index 7cc05e0c02812..49181b39fd21d 100644 --- a/trunk/ceph/kernel/client.c +++ b/trunk/ceph/kernel/client.c @@ -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); } } diff --git a/trunk/ceph/kernel/client.h b/trunk/ceph/kernel/client.h index 9c2b02c9dd920..78abde72ec92d 100644 --- a/trunk/ceph/kernel/client.h +++ b/trunk/ceph/kernel/client.h @@ -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; -- 2.39.5