From 72958a5e47077d0b61a137b49c90a17edf5deae4 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Wed, 20 Nov 2024 11:30:28 -0500 Subject: [PATCH] btrfs-tree: accessors for TreeFetcher classes' type and tree values Sometimes we have a generic TreeFetcher and we need to know which tree it came from. Signed-off-by: Zygo Blaxell --- include/crucible/btrfs-tree.h | 2 ++ lib/btrfs-tree.cc | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/crucible/btrfs-tree.h b/include/crucible/btrfs-tree.h index 1c67b25..8599ae6 100644 --- a/include/crucible/btrfs-tree.h +++ b/include/crucible/btrfs-tree.h @@ -110,7 +110,9 @@ namespace crucible { virtual ~BtrfsTreeFetcher() = default; BtrfsTreeFetcher(Fd new_fd); void type(uint8_t type); + uint8_t type(); void tree(uint64_t tree); + uint64_t tree(); void transid(uint64_t min_transid, uint64_t max_transid = numeric_limits::max()); /// Block size (sectorsize) of filesystem uint64_t block_size() const; diff --git a/lib/btrfs-tree.cc b/lib/btrfs-tree.cc index 14073cb..545d454 100644 --- a/lib/btrfs-tree.cc +++ b/lib/btrfs-tree.cc @@ -283,12 +283,24 @@ namespace crucible { m_type = type; } + uint8_t + BtrfsTreeFetcher::type() + { + return m_type; + } + void BtrfsTreeFetcher::tree(uint64_t tree) { m_tree = tree; } + uint64_t + BtrfsTreeFetcher::tree() + { + return m_tree; + } + void BtrfsTreeFetcher::transid(uint64_t min_transid, uint64_t max_transid) {