From c45c81b29fb7222ce87881261490cde12b59f001 Mon Sep 17 00:00:00 2001 From: Gu Zhongyan Date: Mon, 26 Mar 2018 15:24:58 +0800 Subject: [PATCH] os/bluestore: fix some code formatting Signed-off-by: Gu Zhongyan --- src/os/bluestore/BlueStore.cc | 8 ++++---- src/os/bluestore/NVMEDevice.cc | 8 ++++---- src/os/bluestore/bluestore_types.cc | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 3710cd358de..3b96b6a7838 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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::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)val); } return boost::optional(); @@ -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)val); } return boost::optional(); diff --git a/src/os/bluestore/NVMEDevice.cc b/src/os/bluestore/NVMEDevice.cc index 0852d82466a..546bb245a99 100644 --- a/src/os/bluestore/NVMEDevice.cc +++ b/src/os/bluestore/NVMEDevice.cc @@ -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); } diff --git a/src/os/bluestore/bluestore_types.cc b/src/os/bluestore/bluestore_types.cc index 77a39882609..1ad0e0ce592 100644 --- a/src/os/bluestore/bluestore_types.cc +++ b/src/os/bluestore/bluestore_types.cc @@ -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;