From 4def09a17a65ee4b4ecbd6e5815be5493edc06f7 Mon Sep 17 00:00:00 2001 From: "Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com)" Date: Wed, 16 Jun 2021 16:56:33 +0100 Subject: [PATCH] Fix traversal_summary not being copyable nor moveable, which was never intended. --- include/llfio/v2.0/algorithm/summarize.hpp | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/include/llfio/v2.0/algorithm/summarize.hpp b/include/llfio/v2.0/algorithm/summarize.hpp index df797dadb..467d1bdeb 100644 --- a/include/llfio/v2.0/algorithm/summarize.hpp +++ b/include/llfio/v2.0/algorithm/summarize.hpp @@ -59,6 +59,65 @@ namespace algorithm handle::extent_type directory_blocks{0}; //!< The sum of directory allocated blocks. size_t max_depth{0}; //!< The maximum depth of the hierarchy + traversal_summary() {} + traversal_summary(const traversal_summary &o) + : directory_opens_failed(o.directory_opens_failed) + , want(o.want) + , devs(o.devs) + , types(o.types) + , size(o.size) + , allocated(o.allocated) + , file_blocks(o.file_blocks) + , directory_blocks(o.directory_blocks) + , max_depth(o.max_depth) + { + assert(!is_lockable_locked(o._lock)); + } + traversal_summary(traversal_summary &&o) noexcept + : directory_opens_failed(o.directory_opens_failed) + , want(o.want) + , devs(std::move(o.devs)) + , types(std::move(o.types)) + , size(o.size) + , allocated(o.allocated) + , file_blocks(o.file_blocks) + , directory_blocks(o.directory_blocks) + , max_depth(o.max_depth) + { + assert(!is_lockable_locked(o._lock)); + } + traversal_summary &operator=(const traversal_summary &o) + { + if(this != &o) + { + directory_opens_failed = o.directory_opens_failed; + want = o.want; + devs = o.devs; + types = o.types; + size = o.size; + allocated = o.allocated; + file_blocks = o.file_blocks; + directory_blocks = o.directory_blocks; + max_depth = o.max_depth; + } + return *this; + } + traversal_summary &operator=(traversal_summary &&o) noexcept + { + if(this != &o) + { + directory_opens_failed = o.directory_opens_failed; + want = o.want; + devs = std::move(o.devs); + types = std::move(o.types); + size = o.size; + allocated = o.allocated; + file_blocks = o.file_blocks; + directory_blocks = o.directory_blocks; + max_depth = o.max_depth; + } + return *this; + } //! Adds another summary to this traversal_summary &operator+=(const traversal_summary &o) {