Skip to content

Commit 1b47950

Browse files
Merge pull request ceph#60175 from MaxKellermann/misc_optimizations
Misc optimizations
2 parents c6fbca3 + f261347 commit 1b47950

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/blk/aio/aio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ std::ostream& operator<<(std::ostream& os, const aio_t& aio);
8888

8989
typedef boost::intrusive::list<
9090
aio_t,
91+
boost::intrusive::constant_time_size<false>,
9192
boost::intrusive::member_hook<
9293
aio_t,
9394
boost::intrusive::list_member_hook<>,

src/client/barrier.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void BarrierContext::commit_barrier(barrier_interval &civ)
119119
std::unique_lock locker(lock);
120120

121121
/* we commit outstanding writes--if none exist, we don't care */
122-
if (outstanding_writes.size() == 0)
122+
if (outstanding_writes.empty())
123123
return;
124124

125125
boost::icl::interval_set<uint64_t> cvs;
@@ -174,7 +174,7 @@ void BarrierContext::complete(C_Block_Sync &cbs)
174174
/* signal waiters */
175175
barrier->cond.notify_all();
176176
/* dispose cleared barrier */
177-
if (barrier->write_list.size() == 0) {
177+
if (barrier->write_list.empty()) {
178178
BarrierList::iterator iter2 =
179179
BarrierList::s_iterator_to(*barrier);
180180
active_commits.erase(iter2);

src/client/barrier.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class BarrierContext;
4545
class C_Block_Sync;
4646

4747
typedef boost::intrusive::list< C_Block_Sync,
48+
boost::intrusive::constant_time_size<false>,
4849
boost::intrusive::member_hook<
4950
C_Block_Sync,
5051
boost::intrusive::list_member_hook<>,
@@ -68,6 +69,7 @@ class Barrier
6869
};
6970

7071
typedef boost::intrusive::list< Barrier,
72+
boost::intrusive::constant_time_size<false>,
7173
boost::intrusive::member_hook<
7274
Barrier,
7375
boost::intrusive::list_member_hook<>,

0 commit comments

Comments
 (0)