From efbb1ac90668c2e726ba008e4d79810a78ac4d3b Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou Date: Tue, 2 Jan 2024 12:08:45 +0100 Subject: [PATCH] os/bluestore: Buffer move ctor Introduce move constructor to Buffers. Signed-off-by: Pere Diaz Bou --- src/os/bluestore/BlueStore.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index 4b157f86502..44dace5f490 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -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; } -- 2.39.5