From: Kefu Chai Date: Wed, 10 Mar 2021 08:08:36 +0000 (+0800) Subject: auth,msg,common: test: use s/init_le*/ceph_le*/ X-Git-Tag: v17.1.0~2643^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5deb55aec0590ba0c50ea11bc44ef539716bff06;p=ceph.git auth,msg,common: test: use s/init_le*/ceph_le*/ for better readability. Signed-off-by: Kefu Chai --- diff --git a/src/auth/cephx/CephxSessionHandler.cc b/src/auth/cephx/CephxSessionHandler.cc index d1417d6caf7b..6b27125688a3 100644 --- a/src/auth/cephx/CephxSessionHandler.cc +++ b/src/auth/cephx/CephxSessionHandler.cc @@ -56,9 +56,9 @@ int CephxSessionHandler::_calc_signature(Message *m, uint64_t *psig) ceph_le32 middle_crc; ceph_le32 data_crc; } __attribute__ ((packed)) sigblock = { - 1, init_le64(AUTH_ENC_MAGIC), init_le32(4*4), - init_le32(header.crc), init_le32(footer.front_crc), - init_le32(footer.middle_crc), init_le32(footer.data_crc) + 1, ceph_le64(AUTH_ENC_MAGIC), ceph_le32(4 * 4), + ceph_le32(header.crc), ceph_le32(footer.front_crc), + ceph_le32(footer.middle_crc), ceph_le32(footer.data_crc) }; char exp_buf[CryptoKey::get_max_outbuf_size(sizeof(sigblock))]; @@ -91,14 +91,14 @@ int CephxSessionHandler::_calc_signature(Message *m, uint64_t *psig) ceph_le32 data_len; ceph_le32 seq_lower_word; } __attribute__ ((packed)) sigblock = { - init_le32(header.crc), - init_le32(footer.front_crc), - init_le32(header.front_len), - init_le32(footer.middle_crc), - init_le32(header.middle_len), - init_le32(footer.data_crc), - init_le32(header.data_len), - init_le32(header.seq) + ceph_le32(header.crc), + ceph_le32(footer.front_crc), + ceph_le32(header.front_len), + ceph_le32(footer.middle_crc), + ceph_le32(header.middle_len), + ceph_le32(footer.data_crc), + ceph_le32(header.data_len), + ceph_le32(header.seq) }; char exp_buf[CryptoKey::get_max_outbuf_size(sizeof(sigblock))]; diff --git a/src/common/CDC.cc b/src/common/CDC.cc index e478ba46e51a..8aabeaffc4e8 100644 --- a/src/common/CDC.cc +++ b/src/common/CDC.cc @@ -37,7 +37,7 @@ void generate_buffer(int size, bufferlist *outbl, int seed) p.set_length(l); char *b = p.c_str(); for (size_t i = 0; i < l / sizeof(uint64_t); ++i) { - ((ceph_le64 *)b)[i] = init_le64(engine()); + ((ceph_le64 *)b)[i] = ceph_le64(engine()); } outbl->append(p); } diff --git a/src/libradosstriper/RadosStriperImpl.cc b/src/libradosstriper/RadosStriperImpl.cc index 01e893dea067..6801fba68843 100644 --- a/src/libradosstriper/RadosStriperImpl.cc +++ b/src/libradosstriper/RadosStriperImpl.cc @@ -105,13 +105,13 @@ /// default object layout static const struct ceph_file_layout default_file_layout = { - init_le32(1<<22), // fl_stripe_unit - init_le32(1), // fl_stripe_count - init_le32(1<<22), // fl_object_size - init_le32(0), // fl_cas_hash - init_le32(0), // fl_object_stripe_unit - init_le32(-1), // fl_unused - init_le32(-1), // fl_pg_pool + ceph_le32(1<<22), // fl_stripe_unit + ceph_le32(1), // fl_stripe_count + ceph_le32(1<<22), // fl_object_size + ceph_le32(0), // fl_cas_hash + ceph_le32(0), // fl_object_stripe_unit + ceph_le32(-1), // fl_unused + ceph_le32(-1), // fl_pg_pool }; using libradosstriper::MultiAioCompletionImplPtr; diff --git a/src/messages/MClientRequest.h b/src/messages/MClientRequest.h index c51f1149e0cd..6977c71f07c1 100644 --- a/src/messages/MClientRequest.h +++ b/src/messages/MClientRequest.h @@ -226,7 +226,7 @@ public: localmask &= ~CEPH_SETATTR_BTIME; - head.args.setattr.btime = { init_le32(0), init_le32(0) }; + head.args.setattr.btime = { ceph_le32(0), ceph_le32(0) }; head.args.setattr.mask = localmask; } } diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 855006447f79..2419aabe2ff9 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -527,8 +527,8 @@ ssize_t ProtocolV2::write_message(Message *m, bool more) { ceph_msg_header2 header2{header.seq, header.tid, header.type, header.priority, header.version, - init_le32(0), header.data_off, - init_le64(ack_seq), + ceph_le32(0), header.data_off, + ceph_le64(ack_seq), footer.flags, header.compat_version, header.reserved}; @@ -1359,16 +1359,16 @@ CtPtr ProtocolV2::handle_message() { current_header.type, current_header.priority, current_header.version, - init_le32(msg_frame.front_len()), - init_le32(msg_frame.middle_len()), - init_le32(msg_frame.data_len()), + ceph_le32(msg_frame.front_len()), + ceph_le32(msg_frame.middle_len()), + ceph_le32(msg_frame.data_len()), current_header.data_off, peer_name, current_header.compat_version, current_header.reserved, - init_le32(0)}; - ceph_msg_footer footer{init_le32(0), init_le32(0), - init_le32(0), init_le64(0), current_header.flags}; + ceph_le32(0)}; + ceph_msg_footer footer{ceph_le32(0), ceph_le32(0), + ceph_le32(0), ceph_le64(0), current_header.flags}; Message *message = decode_message(cct, 0, header, footer, msg_frame.front(), diff --git a/src/msg/msg_types.h b/src/msg/msg_types.h index 76a1c1ac2a76..cf0574972d30 100644 --- a/src/msg/msg_types.h +++ b/src/msg/msg_types.h @@ -77,7 +77,7 @@ public: bool is_mgr() const { return type() == TYPE_MGR; } operator ceph_entity_name() const { - ceph_entity_name n = { _type, init_le64(_num) }; + ceph_entity_name n = { _type, ceph_le64(_num) }; return n; } diff --git a/src/os/Transaction.h b/src/os/Transaction.h index 8ad164088a09..93b6272254c7 100644 --- a/src/os/Transaction.h +++ b/src/os/Transaction.h @@ -185,11 +185,11 @@ public: ceph_le32 fadvise_flags; TransactionData() noexcept : - ops(init_le64(0)), - largest_data_len(init_le32(0)), - largest_data_off(init_le32(0)), - largest_data_off_in_data_bl(init_le32(0)), - fadvise_flags(init_le32(0)) { } + ops(0), + largest_data_len(0), + largest_data_off(0), + largest_data_off_in_data_bl(0), + fadvise_flags(0) { } // override default move operations to reset default values TransactionData(TransactionData&& other) noexcept :