Merge pull request #10704 from chhabaramesh/master

os/bluestore/BitAllocator: batch is_allocated bit checks

Reviewed-by: Ramesh Chander <Ramesh.Chander@sandisk.com>
This commit is contained in:
Sage Weil 2016-08-12 09:38:39 -04:00 committed by GitHub
commit 8bf851c4b3

View File

@ -143,14 +143,10 @@ bmap_t BmapEntry::atomic_fetch()
return m_bits;
}
bool BmapEntry::is_allocated(int64_t start_bit, int64_t num_bits)
bool BmapEntry::is_allocated(int64_t offset, int64_t num_bits)
{
for (int i = start_bit; i < num_bits + start_bit; i++) {
if (!check_bit(i)) {
return false;
}
}
return true;
bmap_t bmask = BmapEntry::align_mask(num_bits) >> offset;
return ((m_bits & bmask) == bmask);
}
void BmapEntry::clear_bit(int bit)