]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages: Clean up endian handling
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 16 Sep 2019 15:20:29 +0000 (17:20 +0200)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 18 Sep 2019 11:33:59 +0000 (13:33 +0200)
Replace remaining uses of __le16/__le32/__le64 in contexts that are
not relevant to code generation.

Also, add missing calls to init_le32 in an initializer.

This change is a no-op on all architectures.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
src/messages/MClientRequest.h
src/messages/MOSDOp.h

index 20118cdd32a20fcce6e2f578d517c12ebce0bc86..944cd8810c0e15b9cb01427efe7a5334f6312d19 100644 (file)
@@ -193,7 +193,7 @@ public:
 
        localmask &= ~CEPH_SETATTR_BTIME;
 
-       head.args.setattr.btime = { 0 };
+       head.args.setattr.btime = { init_le32(0), init_le32(0) };
        head.args.setattr.mask = localmask;
       }
     }
index ad3a75a67ec827ccbe182547b101f21220aa13da..43bd400546982a7e3b8d0317f5f0783113adbcfa 100644 (file)
@@ -257,22 +257,22 @@ public:
       // here is the old structure we are encoding to: //
 #if 0
 struct ceph_osd_request_head {
-       __le32 client_inc;                 /* client incarnation */
+       ceph_le32 client_inc;              /* client incarnation */
        struct ceph_object_layout layout;  /* pgid */
-       __le32 osdmap_epoch;               /* client's osdmap epoch */
+       ceph_le32 osdmap_epoch;            /* client's osdmap epoch */
 
-       __le32 flags;
+       ceph_le32 flags;
 
        struct ceph_timespec mtime;        /* for mutations only */
        struct ceph_eversion reassert_version; /* if we are replaying op */
 
-       __le32 object_len;     /* length of object name */
+       ceph_le32 object_len;     /* length of object name */
 
-       __le64 snapid;         /* snapid to read */
-       __le64 snap_seq;       /* writer's snap context */
-       __le32 num_snaps;
+       ceph_le64 snapid;         /* snapid to read */
+       ceph_le64 snap_seq;       /* writer's snap context */
+       ceph_le32 num_snaps;
 
-       __le16 num_ops;
+       ceph_le16 num_ops;
        struct ceph_osd_op ops[];  /* followed by ops[], obj, ticket, snaps */
 } __attribute__ ((packed));
 #endif