]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: move FileRef when constructing FileWriter
authorKefu Chai <kchai@redhat.com>
Sun, 6 Oct 2019 09:35:28 +0000 (17:35 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 6 Oct 2019 15:59:44 +0000 (23:59 +0800)
no need to update the reference, we can just consume it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/os/bluestore/BlueFS.h

index 14dc7bdf906a364cb45c1c1425cf4f35964d1079..683e99237048892e0c68423a8f24c5de3c761666 100644 (file)
@@ -158,13 +158,13 @@ public:
     std::array<bool, MAX_BDEV> dirty_devs;
 
     FileWriter(FileRef f)
-      : file(f),
+      : file(std::move(f)),
        buffer_appender(buffer.get_page_aligned_appender(
                          g_conf()->bluefs_alloc_size / CEPH_PAGE_SIZE)) {
       ++file->num_writers;
       iocv.fill(nullptr);
       dirty_devs.fill(false);
-      if (f->fnode.ino == 1) {
+      if (file->fnode.ino == 1) {
        write_hint = WRITE_LIFE_MEDIUM;
       }
     }
@@ -250,7 +250,7 @@ public:
     MEMPOOL_CLASS_HELPERS();
 
     FileRef file;
-    explicit FileLock(FileRef f) : file(f) {}
+    explicit FileLock(FileRef f) : file(std::move(f)) {}
   };
 
 private: