]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "NVMEDevice: add default constructor for Task and clean up" 7729/head
authorHaomai Wang <haomai@xsky.com>
Sun, 21 Feb 2016 13:01:10 +0000 (21:01 +0800)
committerHaomai Wang <haomai@xsky.com>
Sun, 21 Feb 2016 13:01:10 +0000 (21:01 +0800)
This reverts commit feaa4573366cce27b5523d2838ca09708c4c0b35.

src/os/bluestore/NVMEDevice.cc
src/os/bluestore/NVMEDevice.h

index ed849e69ae597783afa120de6dce82da73274f06..4006f4b4ad8691f54a394d02651e817980abed83 100644 (file)
@@ -744,8 +744,11 @@ int NVMEDevice::aio_write(
   t->offset = off;
   t->len = len;
   t->device = this;
+  t->return_code = 0;
+  t->next = nullptr;
 
   if (buffered) {
+    t->ctx = nullptr;
     // Only need to push the first entry
     driver->queue_task(t);
     Mutex::Locker l(buffer_lock);
@@ -793,7 +796,8 @@ int NVMEDevice::aio_zero(
     t->len = len;
     t->device = this;
     t->buf = nullptr;
-
+    t->return_code = 0;
+    t->next = nullptr;
     t->ctx = ioc;
     Task *first = static_cast<Task*>(ioc->nvme_task_first);
     Task *last = static_cast<Task*>(ioc->nvme_task_last);
@@ -852,6 +856,7 @@ int NVMEDevice::read(uint64_t off, uint64_t len, bufferlist *pbl,
   t->len = len;
   t->device = this;
   t->return_code = 1;
+  t->next = nullptr;
   ++ioc->num_reading;
   driver->queue_task(t);
 
@@ -912,6 +917,7 @@ int NVMEDevice::read_buffered(uint64_t off, uint64_t len, char *buf)
   t->len = aligned_len;
   t->device = this;
   t->return_code = 1;
+  t->next = nullptr;
   ++ioc.num_reading;
   driver->queue_task(t);
 
index 4a7900acba602917c2ec5c20513bda7b57ead142..a47962b2165481c6cde5921d83a973b3593a5590 100644 (file)
@@ -42,14 +42,13 @@ enum class IOCommand {
 class NVMEDevice;
 
 struct Task {
-  NVMEDevice *device = nullptr;
-  IOContext *ctx = nullptr;
+  NVMEDevice *device;
+  IOContext *ctx;
   IOCommand command;
-  uint64_t offset = 0;
-  uint64_t len = 0;
-  void *buf = nullptr;
-  Task *next = nullptr;
-  int64_t return_code = 0;
+  uint64_t offset, len;
+  void *buf;
+  Task *next;
+  int64_t return_code;
   utime_t start;
 };