]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: pass txc to _do_wal_op
authorSage Weil <sage@redhat.com>
Wed, 11 May 2016 19:30:14 +0000 (15:30 -0400)
committerSage Weil <sage@redhat.com>
Wed, 1 Jun 2016 15:38:46 +0000 (11:38 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index b0582363ed4c6a474188523a5e6ab9dd463e4267..d102d18440a3ade8d678f22a1d3d4a67d8ccd6c6 100644 (file)
@@ -4229,7 +4229,7 @@ int BlueStore::_wal_apply(TransContext *txc)
   for (list<bluestore_wal_op_t>::iterator p = wt.ops.begin();
        p != wt.ops.end();
        ++p, ++q) {
-    int r = _do_wal_op(*p, &txc->ioc);
+    int r = _do_wal_op(txc, *p);
     assert(r == 0);
   }
 
@@ -4251,7 +4251,7 @@ int BlueStore::_wal_finish(TransContext *txc)
   return 0;
 }
 
-int BlueStore::_do_wal_op(bluestore_wal_op_t& wo, IOContext *ioc)
+int BlueStore::_do_wal_op(TransContext *txc, bluestore_wal_op_t& wo)
 {
   const uint64_t block_size = bdev->get_block_size();
   const uint64_t block_mask = ~(block_size - 1);
@@ -4283,7 +4283,7 @@ int BlueStore::_do_wal_op(bluestore_wal_op_t& wo, IOContext *ioc)
       dout(20) << __func__ << "  reading initial partial block 0x"
               << std::hex << src_offset << "~0x" << block_size
               << std::dec << dendl;
-      r = bdev->read(src_offset, block_size, &first, ioc, true);
+      r = bdev->read(src_offset, block_size, &first, &txc->ioc, true);
       assert(r == 0);
       bufferlist t;
       t.substr_of(first, 0, first_len);
@@ -4303,7 +4303,7 @@ int BlueStore::_do_wal_op(bluestore_wal_op_t& wo, IOContext *ioc)
        dout(20) << __func__ << "  reading trailing partial block 0x"
                 << std::hex << last_offset << "~0x" << block_size
                 << std::dec << dendl;
-       r = bdev->read(last_offset, block_size, &last, ioc, true);
+       r = bdev->read(last_offset, block_size, &last, &txc->ioc, true);
         assert(r == 0);
       }
       bufferlist t;
@@ -4312,7 +4312,7 @@ int BlueStore::_do_wal_op(bluestore_wal_op_t& wo, IOContext *ioc)
       bl.claim_append(t);
     }
     assert((bl.length() & ~block_mask) == 0);
-    r = bdev->aio_write(offset, bl, ioc, true);
+    r = bdev->aio_write(offset, bl, &txc->ioc, true);
     assert(r == 0);
   }
   break;
@@ -4326,11 +4326,11 @@ int BlueStore::_do_wal_op(bluestore_wal_op_t& wo, IOContext *ioc)
     assert(wo.extent.length == wo.src_extent.length);
     assert((wo.src_extent.offset & ~block_mask) == 0);
     bufferlist bl;
-    r = bdev->read(wo.src_extent.offset, wo.src_extent.length, &bl, ioc,
+    r = bdev->read(wo.src_extent.offset, wo.src_extent.length, &bl, &txc->ioc,
                       true);
     assert(r == 0);
     assert(bl.length() == wo.extent.length);
-    r = bdev->aio_write(wo.extent.offset, bl, ioc, true);
+    r = bdev->aio_write(wo.extent.offset, bl, &txc->ioc, true);
     assert(r == 0);
   }
   break;
@@ -4347,11 +4347,11 @@ int BlueStore::_do_wal_op(bluestore_wal_op_t& wo, IOContext *ioc)
       dout(20) << __func__ << "  reading initial partial block 0x"
               << std::hex << first_offset << "~0x" << block_size
               << std::dec << dendl;
-      r = bdev->read(first_offset, block_size, &first, ioc, true);
+      r = bdev->read(first_offset, block_size, &first, &txc->ioc, true);
       assert(r == 0);
       size_t z_len = MIN(block_size - first_len, length);
       memset(first.c_str() + first_len, 0, z_len);
-      r = bdev->aio_write(first_offset, first, ioc, true);
+      r = bdev->aio_write(first_offset, first, &txc->ioc, true);
       assert(r == 0);
       offset += block_size - first_len;
       length -= z_len;
@@ -4361,7 +4361,7 @@ int BlueStore::_do_wal_op(bluestore_wal_op_t& wo, IOContext *ioc)
       uint64_t middle_len = length & block_mask;
       dout(20) << __func__ << "  zero 0x" << std::hex << offset << "~0x"
               << length << std::dec << dendl;
-      r = bdev->aio_zero(offset, middle_len, ioc);
+      r = bdev->aio_zero(offset, middle_len, &txc->ioc);
       assert(r == 0);
       offset += middle_len;
       length -= middle_len;
@@ -4372,10 +4372,10 @@ int BlueStore::_do_wal_op(bluestore_wal_op_t& wo, IOContext *ioc)
       bufferlist last;
       dout(20) << __func__ << "  reading trailing partial block 0x"
               << std::hex << offset << "~0x" << block_size << std::dec << dendl;
-      r = bdev->read(offset, block_size, &last, ioc, true);
+      r = bdev->read(offset, block_size, &last, &txc->ioc, true);
       assert(r == 0);
       memset(last.c_str(), 0, length);
-      r = bdev->aio_write(offset, last, ioc, true);
+      r = bdev->aio_write(offset, last, &txc->ioc, true);
       assert(r == 0);
     }
   }
index 980587e16bf72c1006ca7e32091538047e1d1881..15a40e3adc8b699f31bc9a0fb5bf2ecbcbcabe90 100644 (file)
@@ -676,7 +676,7 @@ private:
   bluestore_wal_op_t *_get_wal_op(TransContext *txc, OnodeRef o);
   int _wal_apply(TransContext *txc);
   int _wal_finish(TransContext *txc);
-  int _do_wal_op(bluestore_wal_op_t& wo, IOContext *ioc);
+  int _do_wal_op(TransContext *txc, bluestore_wal_op_t& wo);
   int _wal_replay();
 
   // for fsck