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: remove some copy-pastes #11017

Merged
merged 1 commit into from Sep 8, 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
18 changes: 2 additions & 16 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -1870,14 +1870,7 @@ BlueStore::extent_map_t::iterator BlueStore::ExtentMap::find(
BlueStore::extent_map_t::iterator BlueStore::ExtentMap::find_lextent(
uint64_t offset)
{
Extent dummy(offset);
auto fp = extent_map.lower_bound(dummy);
if (fp != extent_map.begin()) {
--fp;
if (fp->logical_offset + fp->length <= offset) {
++fp;
}
}
auto fp = seek_lextent(offset);
if (fp != extent_map.end() && fp->logical_offset > offset)
return extent_map.end(); // extent is past offset
return fp;
Expand All @@ -1899,14 +1892,7 @@ BlueStore::extent_map_t::iterator BlueStore::ExtentMap::seek_lextent(

bool BlueStore::ExtentMap::has_any_lextents(uint64_t offset, uint64_t length)
{
Extent dummy(offset);
auto fp = extent_map.lower_bound(dummy);
if (fp != extent_map.begin()) {
--fp;
if (fp->logical_offset + fp->length <= offset) {
++fp;
}
}
auto fp = seek_lextent(offset);
if (fp == extent_map.end() || fp->logical_offset >= offset + length) {
return false;
}
Expand Down