Optimization in KDE-PIM
Disable filesystem Copy-On-Write on database files when running on Btrfs
Btrfs documentation recommends disabling Copy-on-Write for databases (or any
large files with small random writes in general) in order to improve performance.
This patch adds a code to detect what filesystem ~/.local/share/akonadi/ is
stored on, and if Btrfs is detected, it will disable COW on this directory (or
on the akonadi.db file in case of SQLite) using an ioctl call.
When CoW is disabled on non-empty directory, only newly created files will be
affected. In case of non-empty files, it's not defined when it will take effect.
For this reason the code is only executed before initializing a new database,
which means that only new users will be affected.
Obviously this feature only works on Linux and the code is disabled on any other