journal: Copy holes when archiving BTRFS journal files
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 14 Jan 2022 16:49:06 +0000 (16:49 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 17 Jan 2022 16:10:18 +0000 (16:10 +0000)
commit12727c2bc2859995cbd561ffc3d9a4d571202254
treebcf125196d73e7b50f85211767373d2f50b99724
parent8646b5d6e6019e95063a49fb3105833b07da5ebc
journal: Copy holes when archiving BTRFS journal files

Previously, the holes we punched earlier would get removed when
copying the file. Let's enable the new COPY_HOLES flag to make
sure this doesn't happen.

In my test, this drops a 800MB btrfs journal (without compression)
to 720 MB.

Fixes #22087
src/journal/journald-file.c
src/shared/copy.c
src/test/test-copy.c