remote-apis icon indicating copy to clipboard operation
remote-apis copied to clipboard

Add the ability to control which files in the input root are hardlinked

Open EdSchouten opened this issue 4 years ago • 2 comments

This change acts as a counter proposal to PR #216. Instead of globally stating whether files should be hardlinked or not, it adds the ability to let clients control whether files are aliased.

It achieves this by adding a salt field to FileNode. If two files have the same salt and all other (non-name) properties match, they SHOULD get constructed in the form of hardlinks.

EdSchouten avatar Apr 12 '22 14:04 EdSchouten

If two files have the same salt and all other (non-name) properties match, they SHOULD get constructed in the form of hardlinks.

This would mean that by default (empty salt), all files with the same digest (and attributes) should be hardlinks to the same inode. In my opinion, this is not a good default.

I'd be fine with allowing such files to be hardlinks if the implementation requires this to be efficient, but I don't think this is the most desirable default. This would be especially problematic if files are mutable. Appending to a mutable empty file would modify all other empty files.

Or did you mean to apply this rule only for files that have a non-empty salt?

juergbi avatar Apr 12 '22 15:04 juergbi

Or did you mean to apply this rule only for files that have a non-empty salt?

That's open for discussion. I'd be fine with that.

EdSchouten avatar Apr 16 '22 19:04 EdSchouten