]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools: Clean up endian handling
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Mon, 16 Sep 2019 15:22:35 +0000 (17:22 +0200)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Wed, 18 Sep 2019 11:35:21 +0000 (13:35 +0200)
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 <ulrich.weigand@de.ibm.com>
src/tools/rados/rados.cc
src/tools/rbd_recover_tool/metadata_h

index c90b3ec7a2b01b38ea721bba92f046eedff46694..a73036cf5513a5eb0c70dffe1e20c67cfcbac4a2 100644 (file)
@@ -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);
index 4aa491b5bd7b83185be7ccc874bca5a066afebdb..b736ceea77899ebad863732c71f64811013e8619 100644 (file)
@@ -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
 #