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

Also, remove unnecessary calls to le16/32/64_to_cpu.

This change is a no-op on all architectures.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
src/crimson/net/ProtocolV2.cc
src/crimson/osd/pg_backend.cc

index 74baefc60c887afa1b2e1941421e8f5ab6ac359b..d10db3f7f695a9ab15da79aac3451934dbe1a688 100644 (file)
@@ -512,7 +512,7 @@ seastar::future<entity_type_t, entity_addr_t> ProtocolV2::banner_exchange()
   INTERCEPT_CUSTOM(custom_bp_t::BANNER_WRITE, bp_type_t::WRITE);
   return write_flush(std::move(bl)).then([this] {
       // 2. read peer banner
-      unsigned banner_len = strlen(CEPH_BANNER_V2_PREFIX) + sizeof(__le16);
+      unsigned banner_len = strlen(CEPH_BANNER_V2_PREFIX) + sizeof(ceph_le16);
       INTERCEPT_CUSTOM(custom_bp_t::BANNER_READ, bp_type_t::READ);
       return read_exactly(banner_len); // or read exactly?
     }).then([this] (auto bl) {
index 211151f7739cf946bdb8760c9f696b3ec3884888..63d4475ac3fa3a05320bfc850a1080de965fd4d6 100644 (file)
@@ -360,8 +360,8 @@ seastar::future<> PGBackend::create(
   const OSDOp& osd_op,
   ceph::os::Transaction& txn)
 {
-  const int flags = le32_to_cpu(osd_op.op.flags);
-  if (os.exists && !os.oi.is_whiteout() && (flags & CEPH_OSD_OP_FLAG_EXCL)) {
+  if (os.exists && !os.oi.is_whiteout() &&
+      (osd_op.op.flags & CEPH_OSD_OP_FLAG_EXCL)) {
     // this is an exclusive create
     throw ceph::osd::make_error(-EEXIST);
   }