diff options
author | Kefu Chai <kchai@redhat.com> | 2020-05-22 13:22:28 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2020-05-27 06:35:11 +0200 |
commit | 0f8243b92105036ec7eda247da2afde1a53525a4 (patch) | |
tree | 6fd96a555f85188c89b3725249400a6a4e834c3f /src/os/Transaction.h | |
parent | include/interval_set: no need to check if an unsigned greater or equal to 0 (diff) | |
download | ceph-0f8243b92105036ec7eda247da2afde1a53525a4.tar.xz ceph-0f8243b92105036ec7eda247da2afde1a53525a4.zip |
os/Transaction: do not use anonymous aggregate with member having ctor
use a single `hint` to replace `hint_type` and `alloc_hint_flags` in
the anonymous union.
this helps to address the compile error reported by GCC-10
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/os/Transaction.h')
-rw-r--r-- | src/os/Transaction.h | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/os/Transaction.h b/src/os/Transaction.h index fe4f25313fe..00e9fc47051 100644 --- a/src/os/Transaction.h +++ b/src/os/Transaction.h @@ -169,14 +169,7 @@ public: ceph_le32 dest_cid; ceph_le32 dest_oid; //OP_CLONE, OP_CLONERANGE ceph_le64 dest_off; //OP_CLONERANGE - union { - struct { - ceph_le32 hint_type; //OP_COLL_HINT - } __attribute__ ((packed)); - struct { - ceph_le32 alloc_hint_flags; //OP_SETALLOCHINT - } __attribute__ ((packed)); - } __attribute__ ((packed)); + ceph_le32 hint; //OP_COLL_HINT,OP_SETALLOCHINT ceph_le64 expected_object_size; //OP_SETALLOCHINT ceph_le64 expected_write_size; //OP_SETALLOCHINT ceph_le32 split_bits; //OP_SPLIT_COLLECTION2,OP_COLL_SET_BITS, @@ -1025,7 +1018,7 @@ public: Op* _op = _get_next_op(); _op->op = OP_COLL_HINT; _op->cid = _get_coll_id(cid); - _op->hint_type = type; + _op->hint = type; encode(hint, data_bl); data.ops = data.ops + 1; } @@ -1259,7 +1252,7 @@ public: _op->oid = _get_object_id(oid); _op->expected_object_size = expected_object_size; _op->expected_write_size = expected_write_size; - _op->alloc_hint_flags = flags; + _op->hint = flags; data.ops = data.ops + 1; } |