From da92220d9d6936ef1aa19333038b7a1d982485a4 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Mon, 7 Aug 2017 09:23:12 -0500 Subject: [PATCH] os/bluestore: clearer comments, not slower code. Signed-off-by: Mark Nelson --- src/os/bluestore/BitmapFreelistManager.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/os/bluestore/BitmapFreelistManager.cc b/src/os/bluestore/BitmapFreelistManager.cc index d3fdbb71a8da7..075d3eff6ef18 100644 --- a/src/os/bluestore/BitmapFreelistManager.cc +++ b/src/os/bluestore/BitmapFreelistManager.cc @@ -191,10 +191,10 @@ int get_next_clear_bit(bufferlist& bl, int start) const char *p = bl.c_str(); int bits = bl.length() << 3; while (start < bits) { - int which_byte = start / 8; - int which_bit = start % 8; - unsigned char byte_mask = 1 << which_bit; - if ((p[which_byte] & byte_mask) == 0) { + // byte = start / 8 (or start >> 3) + // bit = start % 8 (or start & 7) + unsigned char byte_mask = 1 << (start & 7); + if ((p[start >> 3] & byte_mask) == 0) { return start; } ++start; -- 2.39.5