]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Revert" Optimizing the lock of bluestore writing process" 41082/head
authorKefu Chai <kchai@redhat.com>
Thu, 29 Apr 2021 12:01:24 +0000 (20:01 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 29 Apr 2021 12:03:33 +0000 (20:03 +0800)
This reverts commit e80d3f7a891af99ba0d4cfe99e5530016ca867ac.

Fixes: https://tracker.ceph.com/issues/50571
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/os/bluestore/BlueFS.cc

index 5d89d1d0926e43539e465fbd71aa41578703f8c6..8be431dfca085088338111b128993e9e701c59eb 100644 (file)
@@ -859,7 +859,6 @@ void BlueFS::umount(bool avoid_compact)
 
 int BlueFS::prepare_new_device(int id, const bluefs_layout_t& layout)
 {
-  std::unique_lock l(lock);
   dout(1) << __func__ << dendl;
 
   if(id == BDEV_NEWDB) {
@@ -1545,7 +1544,6 @@ int BlueFS::device_migrate_to_existing(
   int dev_target,
   const bluefs_layout_t& layout)
 {
-  std::unique_lock l(lock);
   vector<byte> buf;
   bool buffered = cct->_conf->bluefs_buffered_io;
 
@@ -1689,7 +1687,6 @@ int BlueFS::device_migrate_to_new(
   int dev_target,
   const bluefs_layout_t& layout)
 {
-  std::unique_lock l(lock);
   vector<byte> buf;
   bool buffered = cct->_conf->bluefs_buffered_io;
 
@@ -2814,15 +2811,11 @@ int BlueFS::_flush_range(FileWriter *h, uint64_t offset, uint64_t length)
     uint64_t x_len = std::min(p->length - x_off, length);
     bufferlist t;
     t.substr_of(bl, bloff, x_len);
-    h->lock.lock();
-    lock.unlock();
     if (cct->_conf->bluefs_sync_write) {
       bdev[p->bdev]->write(p->offset + x_off, t, buffered, h->write_hint);
     } else {
       bdev[p->bdev]->aio_write(p->offset + x_off, t, h->iocv[p->bdev], buffered, h->write_hint);
     }
-    lock.lock();
-    h->lock.unlock();
     h->dirty_devs[p->bdev] = true;
     if (p->bdev == BDEV_SLOW) {
       bytes_written_slow += t.length();