mirror of
https://github.com/ceph/ceph
synced 2024-12-28 06:23:08 +00:00
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:
commit
8bf851c4b3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user