]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: Buffer move ctor
authorPere Diaz Bou <pere-altea@hotmail.com>
Tue, 2 Jan 2024 11:08:45 +0000 (12:08 +0100)
committerPere Diaz Bou <pere-altea@hotmail.com>
Tue, 30 Jan 2024 15:05:48 +0000 (16:05 +0100)
Introduce move constructor to Buffers.

Signed-off-by: Pere Diaz Bou <pere-altea@hotmail.com>
src/os/bluestore/BlueStore.h

index 4b157f86502c4da28732f2e4c6133ab9b4f88819..44dace5f49063c86072ca56edc399287e08caa7e 100644 (file)
@@ -313,6 +313,20 @@ public:
       : space(space), state(s), flags(f), seq(q), offset(o),
        length(b.length()), data(b) {}
 
+    Buffer(Buffer &&other) {
+      std::swap(space, other.space);
+      std::swap(state, other.state);
+      std::swap(cache_private, other.cache_private);
+      std::swap(flags, other.flags);
+      std::swap(seq, other.seq);
+      std::swap(offset, other.offset);
+      std::swap(length, other.length);
+      std::swap(data, other.data);
+      std::swap(cache_age_bin, other.cache_age_bin);
+      lru_item.swap_nodes(other.lru_item);
+      state_item.swap_nodes(other.state_item);
+    }
+
     bool is_empty() const {
       return state == STATE_EMPTY;
     }