mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
moveonenospc: enhance the feature to allow using a policy
Just like functions you can now set a policy for moveonfreenospc. This allows for more flexibility. For backwards compatibility moveonfreenospc=true is converted to moveonfreenospc=mfs. minfreespace does apply which is slightly different from original behavior.
This commit is contained in:
parent
f2d4fbfdb2
commit
08d267fc61
23 changed files with 483 additions and 148 deletions
|
|
@ -30,26 +30,26 @@ namespace l
|
|||
int
|
||||
writen(const int fd_,
|
||||
const char *buf_,
|
||||
const size_t count_)
|
||||
const size_t size_)
|
||||
{
|
||||
ssize_t rv;
|
||||
size_t nleft;
|
||||
ssize_t nwritten;
|
||||
|
||||
nleft = count_;
|
||||
nleft = size_;
|
||||
do
|
||||
{
|
||||
nwritten = fs::write(fd_,buf_,nleft);
|
||||
if((nwritten == -1) && (errno == EINTR))
|
||||
rv = fs::write(fd_,buf_,nleft);
|
||||
if((rv == -1) && (errno == EINTR))
|
||||
continue;
|
||||
if(nwritten == -1)
|
||||
if(rv == -1)
|
||||
return -1;
|
||||
|
||||
nleft -= nwritten;
|
||||
buf_ += nwritten;
|
||||
nleft -= rv;
|
||||
buf_ += rv;
|
||||
}
|
||||
while(nleft > 0);
|
||||
|
||||
return count_;
|
||||
return size_;
|
||||
}
|
||||
|
||||
static
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue