]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: add rbd_non_blocking_aio option to image metadata
authorJason Dillaman <dillaman@redhat.com>
Tue, 2 Jun 2015 14:32:41 +0000 (10:32 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 2 Jun 2015 14:32:41 +0000 (10:32 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h
src/librbd/librbd.cc

index 39ae8e7bd2d6dd4d2e68d5ac93530a213f82ad8b..20a9ded3dc491bbdb269b3143b6d24999fedc504 100644 (file)
@@ -843,6 +843,7 @@ public:
     ldout(cct, 20) << __func__ << dendl;
     static uint64_t max_conf_items = 128;
     std::map<string, bool> configs = boost::assign::map_list_of(
+        "rbd_non_blocking_aio", false)(
         "rbd_cache", false)(
         "rbd_cache_writethrough_until_flush", false)(
         "rbd_cache_size", false)(
@@ -908,6 +909,7 @@ public:
         config = cct->_conf->rbd_##config;                                     \
     } while (0);
 
+    ASSIGN_OPTION(non_blocking_aio);
     ASSIGN_OPTION(cache);
     ASSIGN_OPTION(cache_writethrough_until_flush);
     ASSIGN_OPTION(cache_size);
index 16d99e67197af60d3782c3398b4e9d5bb0420e8b..3402e6d18bdc4fa696acac32f5d0dd6712a867a4 100644 (file)
@@ -135,6 +135,7 @@ namespace librbd {
 
     // Configuration
     static const string METADATA_CONF_PREFIX;
+    bool non_blocking_aio;
     bool cache;
     bool cache_writethrough_until_flush;
     uint64_t cache_size;
index 8006120f8971d99a21d9a70f4674d0f86c981543..7d18efb5c8cc35bf3766ec3546460eba2c4afbc7 100644 (file)
@@ -129,7 +129,7 @@ private:
 void submit_aio_read(librbd::ImageCtx *ictx, uint64_t off, size_t len,
                      char *buf, bufferlist *pbl, librbd::AioCompletion *c,
                      int op_flags) {
-  if (ictx->cct->_conf->rbd_non_blocking_aio) {
+  if (ictx->non_blocking_aio) {
     ictx->aio_work_queue->queue(new C_AioReadWQ(ictx, off, len, buf, pbl, c,
                                                 op_flags));
   } else {
@@ -139,7 +139,7 @@ void submit_aio_read(librbd::ImageCtx *ictx, uint64_t off, size_t len,
 
 void submit_aio_write(librbd::ImageCtx *ictx, uint64_t off, size_t len,
                       const char *buf, librbd::AioCompletion *c, int op_flags) {
-  if (ictx->cct->_conf->rbd_non_blocking_aio) {
+  if (ictx->non_blocking_aio) {
     ictx->aio_work_queue->queue(new C_AioWriteWQ(ictx, off, len, buf, c,
                                                  op_flags));
   } else {
@@ -149,7 +149,7 @@ void submit_aio_write(librbd::ImageCtx *ictx, uint64_t off, size_t len,
 
 void submit_aio_discard(librbd::ImageCtx *ictx, uint64_t off, uint64_t len,
                         librbd::AioCompletion *c) {
-  if (ictx->cct->_conf->rbd_non_blocking_aio) {
+  if (ictx->non_blocking_aio) {
     ictx->aio_work_queue->queue(new C_AioDiscardWQ(ictx, off, len, c));
   } else {
     librbd::aio_discard(ictx, off, len, c);
@@ -157,7 +157,7 @@ void submit_aio_discard(librbd::ImageCtx *ictx, uint64_t off, uint64_t len,
 }
 
 void submit_aio_flush(librbd::ImageCtx *ictx, librbd::AioCompletion *c) {
-  if (ictx->cct->_conf->rbd_non_blocking_aio) {
+  if (ictx->non_blocking_aio) {
     ictx->aio_work_queue->queue(new C_AioFlushWQ(ictx, c));
   } else {
     librbd::aio_flush(ictx, c);