From bb9eb83b20f36ee3317dd0b49e623daa6342d87a Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Mon, 16 Sep 2019 17:20:29 +0200 Subject: [PATCH] messages: Clean up endian handling 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 --- src/messages/MClientRequest.h | 2 +- src/messages/MOSDOp.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/messages/MClientRequest.h b/src/messages/MClientRequest.h index 20118cdd32a..944cd8810c0 100644 --- a/src/messages/MClientRequest.h +++ b/src/messages/MClientRequest.h @@ -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; } } diff --git a/src/messages/MOSDOp.h b/src/messages/MOSDOp.h index ad3a75a67ec..43bd4005469 100644 --- a/src/messages/MOSDOp.h +++ b/src/messages/MOSDOp.h @@ -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 -- 2.39.5