os/bluestore: fix some code formatting

Signed-off-by: Gu Zhongyan <guzhongyan@360.cn>
This commit is contained in:
Gu Zhongyan 2018-03-26 15:24:58 +08:00
parent 235f211901
commit c45c81b29f
3 changed files with 11 additions and 11 deletions

View File

@ -4115,7 +4115,7 @@ int BlueStore::_reload_logger()
struct store_statfs_t store_statfs;
int r = statfs(&store_statfs);
if(r >= 0) {
if (r >= 0) {
logger->set(l_bluestore_allocated, store_statfs.allocated);
logger->set(l_bluestore_stored, store_statfs.stored);
logger->set(l_bluestore_compressed, store_statfs.compressed);
@ -10838,7 +10838,7 @@ void BlueStore::_choose_write_options(
comp_mode.load(),
[&]() {
string val;
if(c->pool_opts.get(pool_opts_t::COMPRESSION_MODE, &val)) {
if (c->pool_opts.get(pool_opts_t::COMPRESSION_MODE, &val)) {
return boost::optional<Compressor::CompressionMode>(
Compressor::get_comp_mode_type(val));
}
@ -10874,7 +10874,7 @@ void BlueStore::_choose_write_options(
comp_max_blob_size.load(),
[&]() {
int val;
if(c->pool_opts.get(pool_opts_t::COMPRESSION_MAX_BLOB_SIZE, &val)) {
if (c->pool_opts.get(pool_opts_t::COMPRESSION_MAX_BLOB_SIZE, &val)) {
return boost::optional<uint64_t>((uint64_t)val);
}
return boost::optional<uint64_t>();
@ -10888,7 +10888,7 @@ void BlueStore::_choose_write_options(
comp_min_blob_size.load(),
[&]() {
int val;
if(c->pool_opts.get(pool_opts_t::COMPRESSION_MIN_BLOB_SIZE, &val)) {
if (c->pool_opts.get(pool_opts_t::COMPRESSION_MIN_BLOB_SIZE, &val)) {
return boost::optional<uint64_t>((uint64_t)val);
}
return boost::optional<uint64_t>();

View File

@ -188,7 +188,7 @@ class SharedDriverQueueData {
logger = b.create_perf_counters();
g_ceph_context->get_perfcounters_collection()->add(logger);
bdev->queue_number++;
if(bdev->queue_number.load() == 1)
if (bdev->queue_number.load() == 1)
reap_io = true;
}
@ -459,7 +459,7 @@ void SharedDriverQueueData::_aio_handle(Task *t, IOContext *ioc)
start = ceph::coarse_real_clock::now();
}
if(reap_io)
if (reap_io)
bdev->reap_ioc();
dout(20) << __func__ << " end" << dendl;
}
@ -702,7 +702,7 @@ void io_complete(void *t, const struct spdk_nvme_cpl *completion)
task->fill_cb();
task->release_segs(queue);
// read submitted by AIO
if(!task->return_code) {
if (!task->return_code) {
if (ctx->priv) {
if (!--ctx->num_running) {
task->device->aio_callback(task->device->aio_callback_priv, ctx->priv);
@ -832,7 +832,7 @@ void NVMEDevice::aio_submit(IOContext *ioc)
assert(ioc->num_pending.load() == 0); // we should be only thread doing this
// Only need to push the first entry
ioc->nvme_task_first = ioc->nvme_task_last = nullptr;
if(!queue_t)
if (!queue_t)
queue_t = new SharedDriverQueueData(this, driver);
queue_t->_aio_handle(t, ioc);
}

View File

@ -366,7 +366,7 @@ void bluestore_blob_use_tracker_t::init(
clear();
uint32_t _num_au = round_up_to(full_length, _au_size) / _au_size;
au_size = _au_size;
if( _num_au > 1 ) {
if ( _num_au > 1 ) {
num_au = _num_au;
allocate();
}
@ -378,7 +378,7 @@ void bluestore_blob_use_tracker_t::get(
assert(au_size);
if (!num_au) {
total_bytes += length;
}else {
} else {
auto end = offset + length;
while (offset < end) {
@ -769,7 +769,7 @@ void bluestore_blob_t::allocated(uint32_t b_off, uint32_t length, const PExtentV
uint32_t cur_offs = 0;
auto start_it = extents.begin();
size_t pos = 0;
while(true) {
while (true) {
assert(start_it != extents.end());
if (cur_offs + start_it->length > b_off) {
break;