this silences warnings like:
warning: ‘void* memset(void*, int, size_t)’ writing to an object of
non-trivial type ‘struct uuid_d’; use assignment instead [-Wcl\
ass-memaccess]
uuid_d only contains boost::uuids::uuid, which is "nil" initialized in
uuid_d's ctor. so we don't need to bother with memset() it with 0.
the same applies to entity_inst_t.
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit
557cb0614586880512c9213676f8f6dcd226eb38)
_ref(0), ll_ref(0)
{
memset(&dir_layout, 0, sizeof(dir_layout));
- memset("a, 0, sizeof(quota));
}
~Inode();
if (features & CEPH_FEATURE_MDS_QUOTA)
decode(quota, p);
else
- memset("a, 0, sizeof(quota));
+ quota = quota_info_t{};
if ((features & CEPH_FEATURE_FS_FILE_LAYOUT_V2))
decode(layout.pool_ns, p);
MMonSubscribeAck() : Message(CEPH_MSG_MON_SUBSCRIBE_ACK),
interval(0) {
- memset(&fsid, 0, sizeof(fsid));
}
MMonSubscribeAck(uuid_d& f, int i) : Message(CEPH_MSG_MON_SUBSCRIBE_ACK),
interval(i), fsid(f) { }
{
dout(10) << "create_initial -- creating initial map" << dendl;
LogEntry e;
- memset(&e.who, 0, sizeof(e.who));
e.name = g_conf->name;
e.stamp = ceph_clock_now();
e.prio = CLOG_INFO;
MonMap()
: epoch(0) {
- memset(&fsid, 0, sizeof(fsid));
}
uuid_d& get_fsid() { return fsid; }
encode_features(0),
epoch(e), new_pool_max(-1), new_flags(-1), new_max_osd(-1),
have_crc(false), full_crc(0), inc_crc(0) {
- memset(&fsid, 0, sizeof(fsid));
}
explicit Incremental(bufferlist &bl) {
bufferlist::iterator p = bl.begin();
cached_up_osd_features(0),
crc_defined(false), crc(0),
crush(std::make_shared<CrushWrapper>()) {
- memset(&fsid, 0, sizeof(fsid));
}
private: