bufferlist.o ktcp.o messenger.o \
client.o \
mds_client.o mdsmap.o \
- mon_client.o monmap.o
+ mon_client.o monmap.o \
+ osd_client.o
int attempts = 10;
int which;
- client->mounting = 7;
+ client->mounting = 6; /* FIXME don't wait for osd map, for now */
/* send mount request */
mount_msg = ceph_msg_new(CEPH_MSG_CLIENT_MOUNT, 0, 0, 0);
--- /dev/null
+
+#include <linux/types.h>
+#include <linux/random.h>
+#include "mon_client.h"
+
+
+static int pick_mon(struct ceph_mon_client *monc, int notmon)
+{
+ if (notmon < 0 && monc->last_mon >= 0)
+ return monc->last_mon;
+ monc->last_mon = get_random_int() % monc->monmap.num_mon;
+ return monc->last_mon;
+}
+
+
+
--- /dev/null
+#include <linux/slab.h>
+#include "monmap.h"
+#include "messenger.h"
+
+int ceph_monmap_decode(struct ceph_monmap *m, void **p, void *end)
+{
+ int err;
+
+ if ((err = ceph_decode_64(p, end, &m->epoch)) < 0)
+ return err;
+ if ((err = ceph_decode_32(p, end, &m->num_mon)) < 0)
+ return err;
+
+ m->mon_inst = kmalloc(m->num_mon*sizeof(*m->mon_inst), GFP_KERNEL);
+ if (m->mon_inst == NULL)
+ return -ENOMEM;
+ if ((err = ceph_decode_copy(p, end, m->mon_inst, m->num_mon*sizeof(m->mon_inst[0]))) < 0)
+ goto bad;
+
+ return 0;
+
+bad:
+ kfree(m->mon_inst);
+ m->mon_inst = 0;
+ return err;
+}
--- /dev/null
+
+#include "osd_client.h"
+#include "messenger.h"
+
+
+void ceph_osdc_init(struct ceph_osd_client *osdc)
+{
+ osdc->osdmap = NULL;
+}
+
+void ceph_osdc_handle_map(struct ceph_osd_client *osdc, struct ceph_msg *msg)
+{
+ dout(1, "ceph_osdc_handle_map - implement me\n");
+ ceph_msg_put(msg);
+}
#include "osdmap.h"
*/
struct ceph_osdmap;
-
+struct ceph_msg;
struct ceph_osd_client {
- struct ceph_osdmap *osdmap; /* osd map */
+ struct ceph_osdmap *osdmap; /* current osd map */
};