by raphlinus · 9y ago · 0 comments
However, often times you also need to do encoding conversion, and you can do this at the same time as the copy to the swap file.
If you detect you have btrfs/xfs w/ reflink support, and no encoding change is necessary, you can cheat and just do a CoW of the underlying block ranges and let the FS garbage collect it afterwards (just unlink() your reflink copy immediately).
Another convenient thing you can do with the swap file, is use the tail of it for a write ahead log of the changes in a piecetable and crash recovery.