mirror of https://github.com/trapexit/mergerfs.git
26 changed files with 554 additions and 606 deletions
-
38libfuse/include/fuse_cfg.hpp
-
5libfuse/include/fuse_common.h
-
31libfuse/include/fuse_config.hpp
-
10libfuse/include/fuse_msgbuf.hpp
-
0libfuse/include/int_types.h
-
75libfuse/lib/fuse.cpp
-
21libfuse/lib/fuse_cfg.cpp
-
73libfuse/lib/fuse_config.cpp
-
5libfuse/lib/fuse_i.h
-
10libfuse/lib/fuse_loop.cpp
-
162libfuse/lib/fuse_lowlevel.cpp
-
31libfuse/lib/fuse_msgbuf.cpp
-
65libfuse/lib/mount_generic.c
-
24mkdocs/docs/config/options.md
-
92mkdocs/docs/faq/configuration_and_policies.md
-
10mkdocs/docs/remote_filesystems.md
-
4mkdocs/mkdocs.yml
-
257src/config.cpp
-
53src/config.hpp
-
6src/fuse_create.cpp
-
6src/fuse_init.cpp
-
10src/fuse_open.cpp
-
129src/option_parser.cpp
-
39src/tofrom_ref.hpp
-
2src/tofrom_string.hpp
-
2src/tofrom_wrapper.hpp
@ -0,0 +1,38 @@ |
|||
#pragma once
|
|||
|
|||
#include "int_types.h"
|
|||
|
|||
#include <climits>
|
|||
#include <string>
|
|||
|
|||
#define FUSE_CFG_INVALID_ID -1
|
|||
#define FUSE_CFG_INVALID_UMASK -1
|
|||
|
|||
|
|||
struct fuse_cfg_t |
|||
{ |
|||
s64 uid = FUSE_CFG_INVALID_ID; |
|||
bool valid_uid() const; |
|||
|
|||
s64 gid = FUSE_CFG_INVALID_ID; |
|||
bool valid_gid() const; |
|||
|
|||
s64 umask = FUSE_CFG_INVALID_UMASK; |
|||
bool valid_umask() const; |
|||
|
|||
s64 remember_nodes = 0; |
|||
|
|||
bool debug = false; |
|||
|
|||
int max_background = 0; |
|||
int congestion_threshold = 0; |
|||
u32 max_pages = 32; |
|||
int passthrough_max_stack_depth = 1; |
|||
|
|||
int read_thread_count = 0; |
|||
int process_thread_count = -1; |
|||
int process_thread_queue_depth = 2; |
|||
std::string pin_threads = "false"; |
|||
}; |
|||
|
|||
extern fuse_cfg_t fuse_cfg; |
@ -1,31 +0,0 @@ |
|||
/*
|
|||
ISC License |
|||
|
|||
Copyright (c) 2023, Antonio SJ Musumeci <trapexit@spawn.link> |
|||
|
|||
Permission to use, copy, modify, and/or distribute this software for any |
|||
purpose with or without fee is hereby granted, provided that the above |
|||
copyright notice and this permission notice appear in all copies. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|||
*/ |
|||
|
|||
#pragma once
|
|||
|
|||
#include <string>
|
|||
|
|||
int fuse_config_get_read_thread_count(); |
|||
int fuse_config_get_process_thread_count(); |
|||
int fuse_config_get_process_thread_queue_depth(); |
|||
std::string fuse_config_get_pin_threads(); |
|||
|
|||
void fuse_config_set_read_thread_count(int const); |
|||
void fuse_config_set_process_thread_count(int const); |
|||
void fuse_config_set_process_thread_queue_depth(int const); |
|||
void fuse_config_set_pin_threads(std::string const); |
@ -0,0 +1,21 @@ |
|||
#include "fuse_cfg.hpp"
|
|||
|
|||
fuse_cfg_t fuse_cfg; |
|||
|
|||
bool |
|||
fuse_cfg_t::valid_uid() const |
|||
{ |
|||
return (uid != FUSE_CFG_INVALID_ID); |
|||
} |
|||
|
|||
bool |
|||
fuse_cfg_t::valid_gid() const |
|||
{ |
|||
return (gid != FUSE_CFG_INVALID_ID); |
|||
} |
|||
|
|||
bool |
|||
fuse_cfg_t::valid_umask() const |
|||
{ |
|||
return (umask != FUSE_CFG_INVALID_UMASK); |
|||
} |
@ -1,73 +0,0 @@ |
|||
/*
|
|||
ISC License |
|||
|
|||
Copyright (c) 2023, Antonio SJ Musumeci <trapexit@spawn.link> |
|||
|
|||
Permission to use, copy, modify, and/or distribute this software for any |
|||
purpose with or without fee is hereby granted, provided that the above |
|||
copyright notice and this permission notice appear in all copies. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|||
*/ |
|||
|
|||
#include <string>
|
|||
|
|||
static int g_READ_THREAD_COUNT = -1; |
|||
static int g_PROCESS_THREAD_COUNT = -1; |
|||
static int g_PROCESS_THREAD_QUEUE_DEPTH = -1; |
|||
static std::string g_PIN_THREADS = {}; |
|||
|
|||
|
|||
int |
|||
fuse_config_get_read_thread_count() |
|||
{ |
|||
return g_READ_THREAD_COUNT; |
|||
} |
|||
|
|||
void |
|||
fuse_config_set_read_thread_count(int const v_) |
|||
{ |
|||
g_READ_THREAD_COUNT = v_; |
|||
} |
|||
|
|||
int |
|||
fuse_config_get_process_thread_count() |
|||
{ |
|||
return g_PROCESS_THREAD_COUNT; |
|||
} |
|||
|
|||
void |
|||
fuse_config_set_process_thread_count(int const v_) |
|||
{ |
|||
g_PROCESS_THREAD_COUNT = v_; |
|||
} |
|||
|
|||
int |
|||
fuse_config_get_process_thread_queue_depth() |
|||
{ |
|||
return g_PROCESS_THREAD_QUEUE_DEPTH; |
|||
} |
|||
|
|||
void |
|||
fuse_config_set_process_thread_queue_depth(int const v_) |
|||
{ |
|||
g_PROCESS_THREAD_QUEUE_DEPTH = v_; |
|||
} |
|||
|
|||
std::string |
|||
fuse_config_get_pin_threads() |
|||
{ |
|||
return g_PIN_THREADS; |
|||
} |
|||
|
|||
void |
|||
fuse_config_set_pin_threads(std::string const v_) |
|||
{ |
|||
g_PIN_THREADS = v_; |
|||
} |
@ -0,0 +1,39 @@ |
|||
#pragma once
|
|||
|
|||
#include "to_string.hpp"
|
|||
#include "from_string.hpp"
|
|||
#include "tofrom_string.hpp"
|
|||
|
|||
|
|||
template<typename T> |
|||
class TFSRef : public ToFromString |
|||
{ |
|||
public: |
|||
int |
|||
from_string(const std::string_view s_) final |
|||
{ |
|||
return str::from(s_,&_data); |
|||
} |
|||
|
|||
std::string |
|||
to_string(void) const final |
|||
{ |
|||
return str::to(_data); |
|||
} |
|||
|
|||
public: |
|||
TFSRef(T &data_) |
|||
: _data(data_) |
|||
{ |
|||
} |
|||
|
|||
TFSRef(T &data_, |
|||
const T val_) |
|||
: _data(data_) |
|||
{ |
|||
_data = val_; |
|||
} |
|||
|
|||
private: |
|||
T &_data; |
|||
}; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue