mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-12-05 06:10:10 -05:00
add link_cow feature
When enabled if a regular file is opened which has a link count > 1 it will copy the file to a temporary file and rename over the original. Effectively breaking the link. This behavior is similar to cow-shell and other LD_PRELOAD based "CoW" solutions.
This commit is contained in:
parent
19a7d43b31
commit
93f7d7d927
18 changed files with 424 additions and 127 deletions
|
|
@ -16,17 +16,17 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "fusefunc.hpp"
|
||||
#include "policy.hpp"
|
||||
|
||||
#include <fuse.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "policy.hpp"
|
||||
#include "fusefunc.hpp"
|
||||
|
||||
namespace mergerfs
|
||||
{
|
||||
class Config
|
||||
|
|
@ -37,8 +37,8 @@ namespace mergerfs
|
|||
public:
|
||||
int set_func_policy(const std::string &fusefunc_,
|
||||
const std::string &policy_);
|
||||
int set_category_policy(const std::string &category,
|
||||
const std::string &policy);
|
||||
int set_category_policy(const std::string &category_,
|
||||
const std::string &policy_);
|
||||
|
||||
public:
|
||||
std::string destmount;
|
||||
|
|
@ -53,6 +53,7 @@ namespace mergerfs
|
|||
bool nullrw;
|
||||
bool ignorepponrename;
|
||||
bool security_capability;
|
||||
bool link_cow;
|
||||
|
||||
public:
|
||||
const Policy *policies[FuseFunc::Enum::END];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue