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: misc fixes #9999

Merged
merged 6 commits into from Jun 30, 2016
Merged
Show file tree
Hide file tree
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
8 changes: 3 additions & 5 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -882,11 +882,10 @@ int BlueStore::BufferSpace::_discard(uint64_t offset, uint64_t length)
bufferlist bl;
bl.substr_of(b->data, b->length - keep, keep);
_add_buffer(new Buffer(this, b->state, b->seq, end, bl), 0, b);
_rm_buffer(i);
} else {
_add_buffer(new Buffer(this, b->state, b->seq, end, keep), 0, b);
_rm_buffer(i);
}
_rm_buffer(i);
cache->_audit("discard end 2");
break;
}
Expand Down Expand Up @@ -1618,7 +1617,6 @@ int BlueStore::_open_bdev(bool create)
assert(block_size == 1u << block_size_order);

_set_alloc_sizes();
max_alloc_size = g_conf->bluestore_max_alloc_size;
return 0;

fail_close:
Expand Down Expand Up @@ -2738,6 +2736,7 @@ int BlueStore::_fsck_verify_blob_map(
derr << " " << what << " blob " << b.id
<< " has no lextent refs" << dendl;
++errors;
continue;
}
if (pv->second != b.blob.ref_map) {
derr << " " << what << " blob " << b.id
Expand Down Expand Up @@ -3421,7 +3420,6 @@ int BlueStore::_do_read(
<< std::dec << dendl;
pos += hole;
left -= hole;
continue;
}
Blob *bptr = c->get_blob(o, lp->second.blob);
if (bptr == nullptr) {
Expand Down Expand Up @@ -5641,7 +5639,7 @@ void BlueStore::_do_write_small(
}
uint64_t tail_pad =
ROUND_UP_TO(offset + length, chunk_size) - (offset + length);
if (o->onode.has_any_lextents(offset + length, tail_pad)) {
if (tail_pad && o->onode.has_any_lextents(offset + length, tail_pad)) {
tail_pad = 0;
}
bufferlist padded = bl;
Expand Down
5 changes: 0 additions & 5 deletions src/os/bluestore/BlueStore.h
Expand Up @@ -114,14 +114,12 @@ class BlueStore : public ObjectStore,
STATE_EMPTY, ///< empty buffer -- used for cache history
STATE_CLEAN, ///< clean data that is up to date
STATE_WRITING, ///< data that is being written (io not yet complete)
STATE_READING,
};
static const char *get_state_name(int s) {
switch (s) {
case STATE_EMPTY: return "empty";
case STATE_CLEAN: return "clean";
case STATE_WRITING: return "writing";
case STATE_READING: return "reading";
default: return "???";
}
}
Expand Down Expand Up @@ -164,9 +162,6 @@ class BlueStore : public ObjectStore,
bool is_writing() const {
return state == STATE_WRITING;
}
bool is_reading() const {
return state == STATE_READING;
}

uint64_t end() const {
return offset + length;
Expand Down