From f8c8a2b180d1ef402ec2258b4a43e1f7049db737 Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Mon, 18 Nov 2019 12:43:12 +0300 Subject: [PATCH] os/bluestore: micro optimizattion of apply_for_bitset_range Signed-off-by: Igor Fedotov --- src/os/bluestore/bluestore_common.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/os/bluestore/bluestore_common.h b/src/os/bluestore/bluestore_common.h index 764574af59b..858cfd88fc5 100755 --- a/src/os/bluestore/bluestore_common.h +++ b/src/os/bluestore/bluestore_common.h @@ -24,12 +24,12 @@ void apply_for_bitset_range(uint64_t off, uint64_t granularity, Bitset &bitset, Func f) { - auto end = round_up_to(off + len, granularity); - while (off < end) { - uint64_t pos = off / granularity; - ceph_assert(pos < bitset.size()); + auto end = round_up_to(off + len, granularity) / granularity; + ceph_assert(end <= bitset.size()); + uint64_t pos = off / granularity; + while (pos < end) { f(pos, bitset); - off += granularity; + pos++; } } -- 2.47.3