mirror of
https://github.com/ceph/ceph
synced 2024-12-28 22:43:29 +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;
|
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++) {
|
bmap_t bmask = BmapEntry::align_mask(num_bits) >> offset;
|
||||||
if (!check_bit(i)) {
|
return ((m_bits & bmask) == bmask);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BmapEntry::clear_bit(int bit)
|
void BmapEntry::clear_bit(int bit)
|
||||||
|
Loading…
Reference in New Issue
Block a user