]> git.hungrycats.org Git - bees/commitdiff
fs: allow BtrfsIoctlLogicalInoArgs to be reused, remove virtual methods
authorZygo Blaxell <bees@furryterror.org>
Tue, 21 Feb 2023 04:44:20 +0000 (23:44 -0500)
committerZygo Blaxell <bees@furryterror.org>
Fri, 24 Feb 2023 03:40:12 +0000 (22:40 -0500)
Some malloc implementations will try to mmap() and munmap() large buffers
every time they are used, causing a severe loss of performance.

Nothing ever overrode the virtual methods, and there was no virtual
destructor, so they cause compiler warnings at build time when used with
a template that tries to delete pointers to them.

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

index df7b93673968ba44712017c339ca426ee5d044a5..6d1780b4cc733d3637b727296f8696fe9e45fa1e 100644 (file)
@@ -69,9 +69,11 @@ namespace crucible {
 
                uint64_t get_flags() const;
                void set_flags(uint64_t new_flags);
+               void set_logical(uint64_t new_logical);
+               void set_size(uint64_t new_size);
 
-               virtual void do_ioctl(int fd);
-               virtual bool do_ioctl_nothrow(int fd);
+               void do_ioctl(int fd);
+               bool do_ioctl_nothrow(int fd);
 
                struct BtrfsInodeOffsetRootSpan {
                        using iterator = BtrfsInodeOffsetRoot*;
index 002c7a795455d5d2333ed1549a5f40313a0bf9fd..4327c289ec8ffe64da78d5443f5b69fe7e913c4a 100644 (file)
--- a/lib/fs.cc
+++ b/lib/fs.cc
@@ -315,6 +315,18 @@ namespace crucible {
                return m_flags;
        }
 
+       void
+       BtrfsIoctlLogicalInoArgs::set_logical(uint64_t new_logical)
+       {
+               m_logical = new_logical;
+       }
+
+       void
+       BtrfsIoctlLogicalInoArgs::set_size(uint64_t new_size)
+       {
+               m_container_size = new_size;
+       }
+
        bool
        BtrfsIoctlLogicalInoArgs::do_ioctl_nothrow(int fd)
        {