]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix some code formatting 21037/head
authorGu Zhongyan <guzhongyan@360.cn>
Mon, 26 Mar 2018 07:24:58 +0000 (15:24 +0800)
committerGu Zhongyan <guzhongyan@360.cn>
Mon, 26 Mar 2018 07:24:58 +0000 (15:24 +0800)
Signed-off-by: Gu Zhongyan <guzhongyan@360.cn>
src/os/bluestore/BlueStore.cc
src/os/bluestore/NVMEDevice.cc
src/os/bluestore/bluestore_types.cc

index 3710cd358de2123ecda05343826aeea9716ba58b..3b96b6a7838f38401b21ab3058020303e8365c11 100644 (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>();
index 0852d82466a20bc050fe6432bc293868fcf90dd2..546bb245a999d92fdb29d699950a4f8c50b7435b 100644 (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);
   }
index 77a39882609f14363029a1f10db4eb1873364603..1ad0e0ce592cf74433ced85982c79eaac4da46e4 100644 (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;