Browse Source

Ensure cfg references do not also try to initialize the value (#1580)

pull/1582/head
trapexit 2 days ago
committed by GitHub
parent
commit
6813a51fce
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      src/branches.hpp
  2. 27
      src/config.cpp
  3. 7
      src/tofrom_ref.hpp

8
src/branches.hpp

@ -30,6 +30,9 @@
#include <vector>
#include <memory>
#define MINFREESPACE_DEFAULT (4294967295ULL)
class Branches final : public ToFromString
{
public:
@ -64,7 +67,7 @@ public:
using Ptr = Branches::Impl::Ptr;
public:
u64 minfreespace;
u64 minfreespace = MINFREESPACE_DEFAULT;
private:
mutable std::mutex _mutex;
@ -73,7 +76,8 @@ private:
public:
Branches()
: _impl(std::make_shared<Impl>(minfreespace))
{}
{
}
public:
int from_string(const std::string_view str) final;

27
src/config.cpp

@ -37,7 +37,6 @@
#include <sys/stat.h>
#include <unistd.h>
#define MINFREESPACE_DEFAULT (4294967295ULL)
constexpr static const char CACHE_FILES_PROCESS_NAMES_DEFAULT[] =
"rtorrent|"
@ -114,20 +113,20 @@ Config::Config()
link_cow(false),
link_exdev(LinkEXDEV::ENUM::PASSTHROUGH),
log_metrics(false),
minfreespace(branches.minfreespace,MINFREESPACE_DEFAULT),
minfreespace(branches.minfreespace),
mountpoint(),
moveonenospc(true),
nfsopenhack(NFSOpenHack::ENUM::OFF),
nullrw(false),
parallel_direct_writes(true),
passthrough_io(PassthroughIO::ENUM::OFF),
passthrough_max_stack_depth(fuse_cfg.passthrough_max_stack_depth,1),
pin_threads(fuse_cfg.pin_threads,"false"),
passthrough_max_stack_depth(fuse_cfg.passthrough_max_stack_depth),
pin_threads(fuse_cfg.pin_threads),
posix_acl(false),
process_thread_count(fuse_cfg.process_thread_count,-1),
process_thread_queue_depth(fuse_cfg.process_thread_queue_depth,2),
process_thread_count(fuse_cfg.process_thread_count),
process_thread_queue_depth(fuse_cfg.process_thread_queue_depth),
proxy_ioprio(false),
read_thread_count(fuse_cfg.read_thread_count,0),
read_thread_count(fuse_cfg.read_thread_count),
readahead(0),
readdir("seq"),
rename_exdev(RenameEXDEV::ENUM::PASSTHROUGH),
@ -139,20 +138,20 @@ Config::Config()
symlinkify_timeout(3600),
xattr(XAttr::ENUM::PASSTHROUGH),
_congestion_threshold(fuse_cfg.congestion_threshold,0),
_debug(fuse_cfg.debug,false),
_gid(fuse_cfg.gid,FUSE_CFG_INVALID_ID),
_max_background(fuse_cfg.max_background,0),
_congestion_threshold(fuse_cfg.congestion_threshold),
_debug(fuse_cfg.debug),
_gid(fuse_cfg.gid),
_max_background(fuse_cfg.max_background),
_mount(mountpoint),
_mountpoint(mountpoint),
_never_forget_nodes(),
_noforget(),
_remember(fuse_cfg.remember_nodes),
_remember_nodes(fuse_cfg.remember_nodes,0),
_remember_nodes(fuse_cfg.remember_nodes),
_srcmounts(branches),
_threads(fuse_cfg.read_thread_count),
_uid(fuse_cfg.uid,FUSE_CFG_INVALID_ID),
_umask(fuse_cfg.umask,FUSE_CFG_INVALID_UMASK),
_uid(fuse_cfg.uid),
_umask(fuse_cfg.umask),
_version(MERGERFS_VERSION),
_initialized(false)

7
src/tofrom_ref.hpp

@ -27,13 +27,6 @@ public:
{
}
TFSRef(T &data_,
const T val_)
: _data(data_)
{
_data = val_;
}
private:
T &_data;
};
Loading…
Cancel
Save