]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crimson/os: define device_spec_t as packed
authorKefu Chai <tchaikov@gmail.com>
Tue, 13 Dec 2022 10:23:43 +0000 (18:23 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 13 Dec 2022 10:36:17 +0000 (18:36 +0800)
commitae76420eccc76b4f12750fa89941a585e90b5bc5
tree9ad60cbee5d824e354ba927ceec2a7e34eeed80a
parentf1acb2862a3dff12982c068cef68acceb0793a7b
crimson/os: define device_spec_t as packed

per C++ standard 20, alignas cannot be applied to scoped enum. despite
that there is a resolution to address this, see
https://cplusplus.github.io/CWG/issues/2354.html, it's not included in
C++20. so we have to use a different way to address

> runtime error: reference binding to misaligned address 0x610000008395
> for type 'device_type_t', which requires 4 byte alignment

otherwise the code would fail to compile with Clang-15, like:

> <source>:3:13: error: 'alignas' attribute cannot be applied to an enumeration

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/crimson/os/seastore/device.h
src/crimson/os/seastore/seastore_types.h