]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ceph: include type in ceph_entity_addr, filepath
authorSage Weil <sage@newdream.net>
Wed, 27 Jan 2010 22:28:10 +0000 (14:28 -0800)
committerSage Weil <sage@newdream.net>
Fri, 29 Jan 2010 20:41:09 +0000 (12:41 -0800)
Include a type/version in ceph_entity_addr and filepath.  Include extra
byte in filepath encoding as necessary.

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/decode.h
fs/ceph/mds_client.c
fs/ceph/messenger.c
fs/ceph/msgr.h

index 10de84896244b1ecd7720d6fee10831d06ab2545..b90a33b948c7313cb5493e93df2798c079367cce 100644 (file)
@@ -138,6 +138,7 @@ static inline void ceph_encode_filepath(void **p, void *end,
 {
        u32 len = path ? strlen(path) : 0;
        BUG_ON(*p + sizeof(ino) + sizeof(len) + len > end);
+       ceph_encode_8(p, 1);
        ceph_encode_64(p, ino);
        ceph_encode_32(p, len);
        if (len)
index 93998a0678c4ea20ac5f888089af6a2bddfe14e5..4e3e8b229e67e151d9ce5cd9ee3c2da657678829 100644 (file)
@@ -1325,7 +1325,7 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc,
        }
 
        len = sizeof(*head) +
-               pathlen1 + pathlen2 + 2*(sizeof(u32) + sizeof(u64));
+               pathlen1 + pathlen2 + 2*(1 + sizeof(u32) + sizeof(u64));
 
        /* calculate (max) length for cap releases */
        len += sizeof(struct ceph_mds_request_release) *
index 81bc779adb9045dd17aea04525c9ff9ffb4fab33..e4e8d4439d3a39e76c7adfdb86a0a1750ce07df7 100644 (file)
@@ -1909,6 +1909,7 @@ struct ceph_messenger *ceph_messenger_create(struct ceph_entity_addr *myaddr)
                msgr->inst.addr = *myaddr;
 
        /* select a random nonce */
+       msgr->inst.addr.type = 0;
        get_random_bytes(&msgr->inst.addr.nonce, sizeof(msgr->inst.addr.nonce));
        encode_my_addr(msgr);
 
index 40b6189aa9e3497240f9efe0d5ebfa0ff2ff31da..8aaab414f3f8ab84dae8d08cbe7161f9fa425eed 100644 (file)
@@ -21,7 +21,7 @@
  * whenever the wire protocol changes.  try to keep this string length
  * constant.
  */
-#define CEPH_BANNER "ceph v026"
+#define CEPH_BANNER "ceph v027"
 #define CEPH_BANNER_MAX_LEN 30
 
 
@@ -61,7 +61,8 @@ extern const char *ceph_entity_type_name(int type);
  * entity_addr -- network address
  */
 struct ceph_entity_addr {
-       __le64 nonce;  /* unique id for process (e.g. pid) */
+       __le32 type;
+       __le32 nonce;  /* unique id for process (e.g. pid) */
        struct sockaddr_storage in_addr;
 } __attribute__ ((packed));