this post was submitted on 10 Nov 2024
30 points (100.0% liked)

Linux

8409 readers
344 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
all 6 comments
sorted by: hot top controversial new old
[–] Lojcs@lemm.ee 5 points 8 months ago (3 children)

I thought with cow file systems programs didn't have to explicitly reflink since normal copies are already reflinks?

[–] Hirom@beehaw.org 3 points 8 months ago

This isn't a basic copy of a whole file. This is creating a new file from a portion of an existing file.

[–] LaggyKar@programming.dev 1 points 8 months ago

A normal copy consists of a program reading from one file and writing to another. There is no way for the filesystem to do a reflink in that case, it just sees that the program is reading and writing stuff. In order to do a reflink, the program must tell the filesystem what data should be "copied" to where using FICLONE or FICLONERANGE. Though some programs will do that by default if possible nowadays when copying files or when moving files between different subvolumes on the same partition, including the Coreutils cp, mv and install commands and some GUI file managers.

[–] Hirom@beehaw.org 2 points 8 months ago (1 children)

Are there downsides to using reflinks, like alignment and read performance issues?

Compatibility shouldn't be an issue, ie it should be relatively simple and safe to have a fallback that copy when reflink isn't available.