diff options
author | Kefu Chai <kchai@redhat.com> | 2020-05-22 11:53:33 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2020-05-22 15:19:36 +0200 |
commit | d822ffe1fa3e45716bedd3153b9d89b75409df45 (patch) | |
tree | ba625d2ee0ed757c8cbdc77ed664c7b027e9c733 /src/include/ceph_fs.h | |
parent | Merge pull request #35139 from smithfarm/wip-proxy-is-removed (diff) | |
download | ceph-d822ffe1fa3e45716bedd3153b9d89b75409df45.tar.xz ceph-d822ffe1fa3e45716bedd3153b9d89b75409df45.zip |
include/ceph_fs: do not use anonymous aggregate with member having ctor
GCC-10 fails to compile ceph_fs.h, with following error:
In file included from ../src/include/types.h:27,
from ../src/msg/msg_types.h:23,
from ../src/common/ipaddr.cc:16:
../src/include/ceph_fs.h:891:11: error: member ‘ceph_le32 ceph_mds_caps_body_legacy::<unnamed union>::<unnamed struct>::truncate_seq’ with constructor not allowed in anonymous aggregate
891 | __le32 truncate_seq;
| ^~~~~~~~~~~~
../src/include/ceph_fs.h:892:25: error: member ‘ceph_timespec ceph_mds_caps_body_legacy::<unnamed union>::<unnamed struct>::mtime’ with constructor not allowed in anonymous aggregate
892 | struct ceph_timespec mtime, atime, ctime;
| ^~~~~
../src/include/ceph_fs.h:892:32: error: member ‘ceph_timespec ceph_mds_caps_body_legacy::<unnamed union>::<unnamed struct>::atime’ with constructor not allowed in anonymous aggregate
892 | struct ceph_timespec mtime, atime, ctime;
| ^~~~~
../src/include/ceph_fs.h:892:39: error: member ‘ceph_timespec ceph_mds_caps_body_legacy::<unnamed union>::<unnamed struct>::ctime’ with constructor not allowed in anonymous aggregate
892 | struct ceph_timespec mtime, atime, ctime;
| ^~~~~
because, for instance, `ceph_timespec` has compiler generated
constructor, and it's not allowed by C++17 standard.
Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/include/ceph_fs.h')
-rw-r--r-- | src/include/ceph_fs.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/include/ceph_fs.h b/src/include/ceph_fs.h index f7bf65c0662..b01b09adda5 100644 --- a/src/include/ceph_fs.h +++ b/src/include/ceph_fs.h @@ -882,20 +882,19 @@ struct ceph_mds_caps_head { __le64 xattr_version; } __attribute__ ((packed)); -struct ceph_mds_caps_body_legacy { - union { - /* all except export */ - struct { - /* filelock */ - __le64 size, max_size, truncate_size; - __le32 truncate_seq; - struct ceph_timespec mtime, atime, ctime; - struct ceph_file_layout layout; - __le32 time_warp_seq; - } __attribute__ ((packed)); - /* export message */ - struct ceph_mds_cap_peer peer; - } __attribute__ ((packed)); +struct ceph_mds_caps_non_export_body { + /* all except export */ + /* filelock */ + __le64 size, max_size, truncate_size; + __le32 truncate_seq; + struct ceph_timespec mtime, atime, ctime; + struct ceph_file_layout layout; + __le32 time_warp_seq; +} __attribute__ ((packed)); + +struct ceph_mds_caps_export_body { + /* export message */ + struct ceph_mds_cap_peer peer; } __attribute__ ((packed)); /* cap release msg head */ |