]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: update with new monitor message formats
authorSage Weil <sage@newdream.net>
Wed, 24 Jun 2009 20:14:46 +0000 (13:14 -0700)
committerSage Weil <sage@newdream.net>
Wed, 24 Jun 2009 20:15:35 +0000 (13:15 -0700)
src/include/ceph_fs.h
src/kernel/mon_client.c
src/kernel/super.c

index 4036c4af23b74c6fd764921bee9a2a76a4e09ea6..d75e3441f4464ea5af614367e252b3161170202a 100644 (file)
@@ -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
index b3d392840358cd36e941d5a523c2c4108c8fb070..20d536b82a2bd77e6d71156939f222bd75947923 100644 (file)
@@ -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];
index 1a119358063365fdaa84b98a9d53aee22aa17d15..e452b72c8e0c4fccff22c187b41752f5a03d8bf8 100644 (file)
@@ -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);