mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Add ability to proxy ioprio of client apps (#1534)
This commit is contained in:
parent
2f3e807e9d
commit
569a151da2
13 changed files with 217 additions and 1 deletions
33
src/config_proxy_ioprio.cpp
Normal file
33
src/config_proxy_ioprio.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#include "config_proxy_ioprio.hpp"
|
||||
|
||||
#include "ioprio.hpp"
|
||||
#include "from_string.hpp"
|
||||
|
||||
|
||||
ProxyIOPrio::ProxyIOPrio(const bool b_)
|
||||
{
|
||||
ioprio::enable(b_);
|
||||
}
|
||||
|
||||
std::string
|
||||
ProxyIOPrio::to_string(void) const
|
||||
{
|
||||
if(ioprio::enabled())
|
||||
return "true";
|
||||
return "false";
|
||||
}
|
||||
|
||||
int
|
||||
ProxyIOPrio::from_string(const std::string_view s_)
|
||||
{
|
||||
int rv;
|
||||
bool enable;
|
||||
|
||||
rv = str::from(s_,&enable);
|
||||
if(rv)
|
||||
return rv;
|
||||
|
||||
ioprio::enable(enable);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue