News for hackers. Stuff that matters.
Re:Out-Tridging Tridge by improving rsync by kbenson on Wednesday August 28, 2013 @01:42PM (#6291477)
does copying/moving a file over another not trigger copy-on-write in btrfs? If not, it seems a much simpler (but much less cool and useful for all) solution would be to patch rsync with an option to allow writing the temp file over the original when done. While still non-atomic, you'll get the copy-on-write semantics you need. Unfortunately it will use much more IO. There are ways to mitigate the extra IO, such as creating a special diff formatted temp file, but that getting out of the territory of "simple".

Also, in case the FS is saving copies of the temp file and you don't like that, the --temp-dir option might help with that.

Then again, depending on how btrfs treats overwriting a file with a move, if the temp file had a timestamp in the name (patch probably needed) in some form before replacing the original, that might be good enough.

Re:Out-Tridging Tridge by improving rsync by keeperofdakeys on Wednesday August 28, 2013 @07:15PM (#6293266)
Most Unix file systems don't have the semantics of a "move". You unlink an inode from a filename, and link another inode (usually the inode for the tmp file). Then you unlink the original tmp filename. As far as btrfs is concerned, there is no relation between these inodes, and without copying the file (like you suggest), you can't improve this.