From 080a9fae5eacf9e35f0262976d2b54a7ccead081 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Mon, 16 Sep 2019 17:22:35 +0200 Subject: [PATCH] tools: Clean up endian handling Replace remaining uses of __le16/__le32/__le64 in contexts that are not relevant to code generation, or where objects are only used locally and do not require endian swaps. This change is a no-op on all architectures. Signed-off-by: Ulrich Weigand --- src/tools/rados/rados.cc | 4 ++-- src/tools/rbd_recover_tool/metadata_h | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/tools/rados/rados.cc b/src/tools/rados/rados.cc index c90b3ec7a2b01..a73036cf5513a 100644 --- a/src/tools/rados/rados.cc +++ b/src/tools/rados/rados.cc @@ -497,8 +497,8 @@ static int do_get(IoCtx& io_ctx, const char *objname, const char *outfile, unsig static int do_copy(IoCtx& io_ctx, const char *objname, IoCtx& target_ctx, const char *target_obj) { - __le32 src_fadvise_flags = LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL | LIBRADOS_OP_FLAG_FADVISE_NOCACHE; - __le32 dest_fadvise_flags = LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL | LIBRADOS_OP_FLAG_FADVISE_DONTNEED; + uint32_t src_fadvise_flags = LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL | LIBRADOS_OP_FLAG_FADVISE_NOCACHE; + uint32_t dest_fadvise_flags = LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL | LIBRADOS_OP_FLAG_FADVISE_DONTNEED; ObjectWriteOperation op; op.copy_from(objname, io_ctx, 0, src_fadvise_flags); op.set_op_flags2(dest_fadvise_flags); diff --git a/src/tools/rbd_recover_tool/metadata_h b/src/tools/rbd_recover_tool/metadata_h index 4aa491b5bd7b8..b736ceea77899 100644 --- a/src/tools/rbd_recover_tool/metadata_h +++ b/src/tools/rbd_recover_tool/metadata_h @@ -80,19 +80,19 @@ function get_image_format_by_hobject() # 1 __u8 comp_type; # 1 __u8 unused; # } __attribute__((packed)) options; -# 8 __le64 image_size;//hexdump -C s=80 n=8 -# 8 __le64 snap_seq; //hexdump -C s=88 n=8 -# 4 __le32 snap_count;//hexdump -C s=96 n=4 -# 4 __le32 reserved; -# 8 __le64 snap_names_len;//hexdump -C s=104 n=8 +# 8 ceph_le64 image_size;//hexdump -C s=80 n=8 +# 8 ceph_le64 snap_seq; //hexdump -C s=88 n=8 +# 4 ceph_le32 snap_count;//hexdump -C s=96 n=4 +# 4 ceph_le32 reserved; +# 8 ceph_le64 snap_names_len;//hexdump -C s=104 n=8 # struct rbd_obj_snap_ondisk snaps[0]; # } __attribute__((packed)); # # sizeof(rbd_obj_header_ondisk): 112 # # struct rbd_obj_snap_ondisk { -# 8 __le64 id; //hexdump -C s=112+i*16 n=8 , i=[0, snap_count) -# 8 __le64 image_size;//hexdump -C s=112+i*16+8 n=8, i=[0, snap_count) +# 8 ceph_le64 id; //hexdump -C s=112+i*16 n=8 , i=[0, snap_count) +# 8 ceph_le64 image_size;//hexdump -C s=112+i*16+8 n=8, i=[0, snap_count) # } __attribute__((packed)); # sizeof(rbd_obj_snap_ondisk): 16 # -- 2.39.5