From 26166c88e0b47b83972f32b5057ecbffe06bf904 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 3 Mar 2015 00:13:12 +0100 Subject: importd: automatically grow /var/lib/machines/ loopback filesystem during downloads If /var/lib/machines is mounted as btrfs loopback file system in /var/lib/machines.raw with this change we automatically grow the file system as it fills up. After each 10M we write to it during imports, we check the free disk space, and if the fill level grows beyond 66% we increase the size of the file system to 3x the fill level (thus lowering it to 33%). --- src/shared/btrfs-util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/shared/btrfs-util.h') diff --git a/src/shared/btrfs-util.h b/src/shared/btrfs-util.h index e654a3fea1..a2c246b8d6 100644 --- a/src/shared/btrfs-util.h +++ b/src/shared/btrfs-util.h @@ -72,5 +72,5 @@ int btrfs_quota_enable(const char *path, bool b); int btrfs_quota_limit_fd(int fd, uint64_t referred_max); int btrfs_quota_limit(const char *path, uint64_t referred_max); -int btrfs_resize_loopback_fd(int fd, uint64_t size); -int btrfs_resize_loopback(const char *path, uint64_t size); +int btrfs_resize_loopback_fd(int fd, uint64_t size, bool grow_only); +int btrfs_resize_loopback(const char *path, uint64_t size, bool grow_only); -- cgit v1.2.3-54-g00ecf