Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/bluestore/BitAllocator: batch is_allocated bit checks #10704

Merged
merged 1 commit into from
Aug 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/os/bluestore/BitAllocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down