1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 21:35:45 +02:00

fs: allow BtrfsIoctlLogicalInoArgs to be reused, remove virtual methods

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>
This commit is contained in:
Zygo Blaxell 2023-02-20 23:44:20 -05:00
parent a9a5cd03a5
commit 7c764a73c8
2 changed files with 16 additions and 2 deletions

View 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*;

View File

@ -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)
{