summaryrefslogtreecommitdiff
path: root/src/shared/btrfs-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-01-06 19:51:03 +0100
committerLennart Poettering <lennart@poettering.net>2015-01-06 20:31:40 +0100
commitf27a386430cc7a27ebd06899d93310fb3bd4cee7 (patch)
treefaff2e8d41e70dd9477de514f2893d99859ef4ea /src/shared/btrfs-util.h
parent7c75c5ca68970d2d47f211f068883e9b8c3ff5e7 (diff)
journald: whenever we rotate a file, btrfs defrag it
Our write pattern is quite awful for CoW file systems (btrfs...), as we keep updating file parts in the beginning of the file. This results in fragmented journal files. Hence: when rotating files, defragment them, since at that point we know that no further write accesses will be made.
Diffstat (limited to 'src/shared/btrfs-util.h')
-rw-r--r--src/shared/btrfs-util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/btrfs-util.h b/src/shared/btrfs-util.h
index 1532c120df..1bff9171d7 100644
--- a/src/shared/btrfs-util.h
+++ b/src/shared/btrfs-util.h
@@ -57,3 +57,6 @@ int btrfs_subvol_get_quota_fd(int fd, BtrfsQuotaInfo *quota);
int btrfs_reflink(int infd, int outfd);
int btrfs_get_block_device(const char *path, dev_t *dev);
+
+int btrfs_defrag_fd(int fd);
+int btrfs_defrag(const char *p);