]> git.hungrycats.org Git - bees/commitdiff
btrfs-tree: accessors for TreeFetcher classes' type and tree values
authorZygo Blaxell <bees@furryterror.org>
Wed, 20 Nov 2024 16:30:28 +0000 (11:30 -0500)
committerZygo Blaxell <bees@furryterror.org>
Sun, 1 Dec 2024 04:30:33 +0000 (23:30 -0500)
Sometimes we have a generic TreeFetcher and we need to know which tree
it came from.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
include/crucible/btrfs-tree.h
lib/btrfs-tree.cc

index 1c67b2506bf6d647b26b1b235923d834636aa95b..8599ae69444ddfbd342a375c67306ccc75a31ef7 100644 (file)
@@ -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<uint64_t>::max());
                /// Block size (sectorsize) of filesystem
                uint64_t block_size() const;
index 14073cbb64325dd27a4f7c5d0423be98568d56b8..545d454f15d5042451289a90617b47d9d619bf19 100644 (file)
@@ -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)
        {