mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-21 07:26:28 -05:00
Allow setting of scheduling priority
This commit is contained in:
parent
ec5ac0c517
commit
a7113bb163
4 changed files with 12 additions and 6 deletions
|
|
@ -64,6 +64,7 @@ namespace l
|
|||
IFERT("readdirplus");
|
||||
IFERT("threads");
|
||||
IFERT("version");
|
||||
IFERT("scheduling-priority");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -103,6 +104,7 @@ Config::Config()
|
|||
readdir(ReadDir::ENUM::POSIX),
|
||||
readdirplus(false),
|
||||
rename_exdev(RenameEXDEV::ENUM::PASSTHROUGH),
|
||||
scheduling_priority(-10),
|
||||
security_capability(true),
|
||||
srcmounts(branches),
|
||||
statfs(StatFS::ENUM::BASE),
|
||||
|
|
@ -171,6 +173,7 @@ Config::Config()
|
|||
// _map["readdir"] = &readdir;
|
||||
_map["readdirplus"] = &readdirplus;
|
||||
_map["rename-exdev"] = &rename_exdev;
|
||||
_map["scheduling-priority"] = &scheduling_priority;
|
||||
_map["security_capability"] = &security_capability;
|
||||
_map["srcmounts"] = &srcmounts;
|
||||
_map["statfs"] = &statfs;
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ public:
|
|||
ReadDir readdir;
|
||||
ConfigBOOL readdirplus;
|
||||
RenameEXDEV rename_exdev;
|
||||
ConfigINT scheduling_priority;
|
||||
ConfigBOOL security_capability;
|
||||
SrcMounts srcmounts;
|
||||
StatFS statfs;
|
||||
|
|
@ -145,6 +146,7 @@ public:
|
|||
ConfigBOOL writeback_cache;
|
||||
XAttr xattr;
|
||||
|
||||
|
||||
public:
|
||||
friend std::ostream& operator<<(std::ostream &s,
|
||||
const Config &c);
|
||||
|
|
|
|||
|
|
@ -139,15 +139,13 @@ namespace l
|
|||
|
||||
static
|
||||
void
|
||||
setup_resources(void)
|
||||
setup_resources(const int scheduling_priority_)
|
||||
{
|
||||
const int prio = -10;
|
||||
|
||||
std::srand(time(NULL));
|
||||
resources::reset_umask();
|
||||
resources::maxout_rlimit_nofile();
|
||||
resources::maxout_rlimit_fsize();
|
||||
resources::setpriority(prio);
|
||||
resources::setpriority(scheduling_priority_);
|
||||
}
|
||||
|
||||
static
|
||||
|
|
@ -204,7 +202,7 @@ namespace l
|
|||
if(cfg->branches_mount_timeout > 0)
|
||||
l::wait_for_mount(cfg);
|
||||
|
||||
l::setup_resources();
|
||||
l::setup_resources(cfg->scheduling_priority);
|
||||
l::get_fuse_operations(ops,cfg->nullrw);
|
||||
|
||||
return fuse_main(args.argc,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue