From 9ffaaee46e1faa7387f1230c560b01e8fcd70fd4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 24 Jun 2009 13:14:46 -0700 Subject: [PATCH] kclient: update with new monitor message formats --- src/include/ceph_fs.h | 11 ++++++++++- src/kernel/mon_client.c | 8 ++++++-- src/kernel/super.c | 6 +++++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/include/ceph_fs.h b/src/include/ceph_fs.h index 4036c4af23b74..d75e3441f4464 100644 --- a/src/include/ceph_fs.h +++ b/src/include/ceph_fs.h @@ -284,6 +284,7 @@ ceph_full_name_hash(const char *name, unsigned int len) struct ceph_mon_statfs { + __le64 have_version; ceph_fsid_t fsid; __le64 tid; }; @@ -300,15 +301,23 @@ struct ceph_mon_statfs_reply { }; struct ceph_osd_getmap { + __le64 have_version; ceph_fsid_t fsid; __le32 start; } __attribute__ ((packed)); struct ceph_mds_getmap { - __le64 have; + __le64 have_version; ceph_fsid_t fsid; } __attribute__ ((packed)); +struct ceph_client_mount { + __le64 have_version; +} __attribute__ ((packed)); + +struct ceph_client_unmount { + __le64 have_version; +} __attribute__ ((packed)); /* * client authentication ticket diff --git a/src/kernel/mon_client.c b/src/kernel/mon_client.c index b3d392840358c..20d536b82a2bd 100644 --- a/src/kernel/mon_client.c +++ b/src/kernel/mon_client.c @@ -140,7 +140,7 @@ static void request_mdsmap(struct ceph_mon_client *monc, int newmon) return; h = msg->front.iov_base; h->fsid = monc->monmap->fsid; - h->have = cpu_to_le64(monc->want_mdsmap - 1); + h->have_version = cpu_to_le64(monc->want_mdsmap - 1); msg->hdr.dst = monc->monmap->mon_inst[mon]; ceph_msg_send(monc->client->msgr, msg, 0); } @@ -238,11 +238,14 @@ static void request_umount(struct ceph_mon_client *monc, int newmon) { struct ceph_msg *msg; int mon = pick_mon(monc, newmon); + struct ceph_client_mount *h; dout(5, "request_umount from mon%d\n", mon); - msg = ceph_msg_new(CEPH_MSG_CLIENT_UNMOUNT, 0, 0, 0, NULL); + msg = ceph_msg_new(CEPH_MSG_CLIENT_UNMOUNT, sizeof(*h), 0, 0, NULL); if (IS_ERR(msg)) return; + h = msg->front.iov_base; + h->have_version = 0; msg->hdr.dst = monc->monmap->mon_inst[mon]; ceph_msg_send(monc->client->msgr, msg, 0); } @@ -321,6 +324,7 @@ static int send_statfs(struct ceph_mon_client *monc, return PTR_ERR(msg); req->request = msg; h = msg->front.iov_base; + h->have_version = 0; h->fsid = monc->monmap->fsid; h->tid = cpu_to_le64(req->tid); msg->hdr.dst = monc->monmap->mon_inst[mon]; diff --git a/src/kernel/super.c b/src/kernel/super.c index 1a11935806336..e452b72c8e0c4 100644 --- a/src/kernel/super.c +++ b/src/kernel/super.c @@ -807,6 +807,7 @@ static int ceph_mount(struct ceph_client *client, struct vfsmount *mnt, int which; struct dentry *root; unsigned char r; + struct ceph_client_mount *h; dout(10, "mount start\n"); mutex_lock(&client->mount_mutex); @@ -835,11 +836,14 @@ static int ceph_mount(struct ceph_client *client, struct vfsmount *mnt, dout(10, "mount sending mount request\n"); get_random_bytes(&r, 1); which = r % client->mount_args.num_mon; - mount_msg = ceph_msg_new(CEPH_MSG_CLIENT_MOUNT, 0, 0, 0, NULL); + mount_msg = ceph_msg_new(CEPH_MSG_CLIENT_MOUNT, sizeof(*h), 0, + 0, NULL); if (IS_ERR(mount_msg)) { err = PTR_ERR(mount_msg); goto out; } + h = mount_msg->front.iov_base; + h->have_version = 0; mount_msg->hdr.dst.name.type = cpu_to_le32(CEPH_ENTITY_TYPE_MON); mount_msg->hdr.dst.name.num = cpu_to_le32(which); -- 2.39.5