mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
add tagging branches RW/RO/NW
This allows users to tag a branch as readonly or not for writing regardless of how the filesystem is mounted. Should simplify deployments and offer more flexibility.
This commit is contained in:
parent
8dd0dc11ee
commit
b55ebba4ed
57 changed files with 1586 additions and 1210 deletions
|
|
@ -14,14 +14,6 @@
|
|||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <fuse.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "config.hpp"
|
||||
#include "errno.hpp"
|
||||
#include "fileinfo.hpp"
|
||||
|
|
@ -31,6 +23,14 @@
|
|||
#include "ugid.hpp"
|
||||
#include "write.hpp"
|
||||
|
||||
#include <fuse.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
using namespace mergerfs;
|
||||
|
|
@ -83,11 +83,14 @@ namespace mergerfs
|
|||
if(config.moveonenospc)
|
||||
{
|
||||
size_t extra;
|
||||
const ugid::Set ugid(0,0);
|
||||
const rwlock::ReadGuard readlock(&config.srcmountslock);
|
||||
vector<string> paths;
|
||||
const ugid::Set ugid(0,0);
|
||||
const rwlock::ReadGuard readlock(&config.branches_lock);
|
||||
|
||||
config.branches.to_paths(paths);
|
||||
|
||||
extra = fuse_buf_size(src);
|
||||
rv = fs::movefile(config.srcmounts,fi->fusepath,extra,fi->fd);
|
||||
rv = fs::movefile(paths,fi->fusepath,extra,fi->fd);
|
||||
if(rv == -1)
|
||||
return -ENOSPC;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue