From: Haomai Wang Date: Sun, 21 Feb 2016 13:01:10 +0000 (+0800) Subject: Revert "NVMEDevice: add default constructor for Task and clean up" X-Git-Tag: v10.1.0~262^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d20936fc6694758857e463fd03e55360340334ed;p=ceph.git Revert "NVMEDevice: add default constructor for Task and clean up" This reverts commit feaa4573366cce27b5523d2838ca09708c4c0b35. --- diff --git a/src/os/bluestore/NVMEDevice.cc b/src/os/bluestore/NVMEDevice.cc index ed849e69ae59..4006f4b4ad86 100644 --- a/src/os/bluestore/NVMEDevice.cc +++ b/src/os/bluestore/NVMEDevice.cc @@ -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(ioc->nvme_task_first); Task *last = static_cast(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); diff --git a/src/os/bluestore/NVMEDevice.h b/src/os/bluestore/NVMEDevice.h index 4a7900acba60..a47962b21654 100644 --- a/src/os/bluestore/NVMEDevice.h +++ b/src/os/bluestore/NVMEDevice.h @@ -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; };