mirror of
https://github.com/ceph/ceph
synced 2024-12-18 17:37:38 +00:00
OSD: Silence unused variable warnings
Even though extending the lifetime of this temporary delays execution of its destructor, the compiler does not consider the reference to have a side-effecting constructor. The compiler is wrong, but we can silence its complaints. This will cease to be an issue once we adopt C++17, since mandatory RVO will solve the inability to bind a variable to a returned move-only object and the need to extend a temporary. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
parent
87b4d1646e
commit
bda3c2673b
@ -4183,7 +4183,7 @@ bool OSD::maybe_wait_for_max_pg(spg_t pgid, bool is_mon_create)
|
||||
if (pg_map.size() < max_pgs_per_osd) {
|
||||
return false;
|
||||
}
|
||||
auto&& pending_creates_locker = guardedly_lock(pending_creates_lock);
|
||||
[[gnu::unused]] auto&& pending_creates_locker = guardedly_lock(pending_creates_lock);
|
||||
if (is_mon_create) {
|
||||
pending_creates_from_mon++;
|
||||
} else {
|
||||
@ -4221,7 +4221,7 @@ void OSD::resume_creating_pg()
|
||||
return;
|
||||
}
|
||||
unsigned spare_pgs = max_pgs_per_osd - pg_map.size();
|
||||
auto&& locker = guardedly_lock(pending_creates_lock);
|
||||
[[gnu::unused]] auto&& locker = guardedly_lock(pending_creates_lock);
|
||||
if (pending_creates_from_mon > 0) {
|
||||
do_sub_pg_creates = true;
|
||||
if (pending_creates_from_mon >= spare_pgs) {
|
||||
@ -7810,7 +7810,7 @@ void OSD::consume_map()
|
||||
pg->unlock();
|
||||
}
|
||||
|
||||
auto&& pending_create_locker = guardedly_lock(pending_creates_lock);
|
||||
[[gnu::unused]] auto&& pending_create_locker = guardedly_lock(pending_creates_lock);
|
||||
for (auto pg = pending_creates_from_osd.cbegin();
|
||||
pg != pending_creates_from_osd.cend();) {
|
||||
if (osdmap->get_pg_acting_rank(*pg, whoami) < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user