kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
528 stars 239 forks source link

Use reflinks in mkfs.btrfs when using --rootdir? #547

Open DaanDeMeyer opened 1 year ago

DaanDeMeyer commented 1 year ago

I noticed that when using mkfs.btrfs on a loopback file with --rootdir, it doesn't seem to try to reflink the files into the filesystem. Would this be possible at all to avoid copying the data?

kdave commented 8 months ago

Yeah reflink is not implemented. It could as long as it would work for the source and target. It's in add_file_items, source file is read by sectors and needs the checksum calculated. Reflinking would need to look for longest contiguous extent while still adding the checksums.