ceph: some endianity fixes
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 11 Jun 2010 22:57:06 +0000 (15:57 -0700)
committerSage Weil <sage@newdream.net>
Sun, 13 Jun 2010 17:34:36 +0000 (10:34 -0700)
Fix some problems that came up with sparse.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/auth_x.c
fs/ceph/messenger.c
fs/ceph/mon_client.c

index 83d4d2785ffeba31db02a8fc374c146f62bcb201..3fe49042d8adaffe6b0f18de5d1b1fd63def729f 100644 (file)
@@ -493,7 +493,7 @@ static int ceph_x_handle_reply(struct ceph_auth_client *ac, int result,
                return -EAGAIN;
        }
 
-       op = le32_to_cpu(head->op);
+       op = le16_to_cpu(head->op);
        result = le32_to_cpu(head->result);
        dout("handle_reply op %d result %d\n", op, result);
        switch (op) {
index 64b8b1f7863d7af7cbca11bfee570209a10d3e3e..cf1c7845d8778305c2782b3920373691919835c1 100644 (file)
@@ -657,7 +657,7 @@ static void prepare_write_connect(struct ceph_messenger *msgr,
        dout("prepare_write_connect %p cseq=%d gseq=%d proto=%d\n", con,
             con->connect_seq, global_seq, proto);
 
-       con->out_connect.features = CEPH_FEATURE_SUPPORTED_CLIENT;
+       con->out_connect.features = cpu_to_le64(CEPH_FEATURE_SUPPORTED_CLIENT);
        con->out_connect.host_type = cpu_to_le32(CEPH_ENTITY_TYPE_CLIENT);
        con->out_connect.connect_seq = cpu_to_le32(con->connect_seq);
        con->out_connect.global_seq = cpu_to_le32(global_seq);
index 07a539906e67c821a2db3e0c6717c0957d3bbecf..cc115eafae11e23702cc38b7b015f8cf1d7c597c 100644 (file)
@@ -725,7 +725,8 @@ static void handle_auth_reply(struct ceph_mon_client *monc,
                dout("authenticated, starting session\n");
 
                monc->client->msgr->inst.name.type = CEPH_ENTITY_TYPE_CLIENT;
-               monc->client->msgr->inst.name.num = monc->auth->global_id;
+               monc->client->msgr->inst.name.num =
+                                       cpu_to_le64(monc->auth->global_id);
 
                __send_subscribe(monc);
                __resend_generic_request(monc);