mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 10:51:52 -04:00
move on enospc when writing feature. closes #141
This feature mimics the standard mhddfs behavior but is more thorough. If a write fails and the errno is set to ENOSPC then mergerfs will (if the feature is enabled) attempt to move the file to the drive with the most free space but only if it has enough room for the file plus the amount to be written. If that transfer is successful it will then unlink the original file and attempt the previously failed write again. The copy includes copying the path and file including the acls, owners, attributes, extended attributes, and timestamps.
This commit is contained in:
parent
4e5578de9c
commit
5808ab7795
66 changed files with 1837 additions and 665 deletions
|
|
@ -28,6 +28,8 @@
|
|||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "fileinfo.hpp"
|
||||
|
||||
static
|
||||
int
|
||||
_ftruncate(const int fd,
|
||||
|
|
@ -49,7 +51,9 @@ namespace mergerfs
|
|||
off_t size,
|
||||
fuse_file_info *ffi)
|
||||
{
|
||||
return _ftruncate(ffi->fh,
|
||||
FileInfo *fi = reinterpret_cast<FileInfo*>(ffi->fh);
|
||||
|
||||
return _ftruncate(fi->fd,
|
||||
size);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue