summaryrefslogtreecommitdiff
path: root/src/import/import-raw.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-10-11 10:27:59 +0200
committerLennart Poettering <lennart@poettering.net>2018-11-26 18:09:01 +0100
commit5f7ecd610c7918bb89468ce068bfcf68114dc53e (patch)
tree84ede3c89ef2b3f28e04bf353b9debf6a1f6f016 /src/import/import-raw.c
parente21b7229ff776891443fe3200ebf4648f3f2940b (diff)
downloadsystemd-5f7ecd610c7918bb89468ce068bfcf68114dc53e.tar.gz
systemd-5f7ecd610c7918bb89468ce068bfcf68114dc53e.tar.bz2
systemd-5f7ecd610c7918bb89468ce068bfcf68114dc53e.zip
import: drop logic of setting up /var/lib/machines as btrfs loopback mount
Let's simplify things and drop the logic that /var/lib/machines is setup as auto-growing btrfs loopback file /var/lib/machines.raw. THis was done in order to make quota available for machine management, but quite frankly never really worked properly, as we couldn't grow the file system in sync with its use properly. Moreover philosophically it's problematic overriding the admin's choice of file system like this. Let's hence drop this, and simplify things. Deleting code is a good feeling. Now that regular file systems provide project quota we could probably add per-machine quota support based on that, hence the btrfs quota argument is not that interesting anymore (though btrfs quota is a bit more powerful as it allows recursive quota, i.e. that the machine pool gets an overall quota in addition to per-machine quota).
Diffstat (limited to 'src/import/import-raw.c')
-rw-r--r--src/import/import-raw.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c
index e8adaae740..2b96330c14 100644
--- a/src/import/import-raw.c
+++ b/src/import/import-raw.c
@@ -37,7 +37,6 @@ struct RawImport {
char *local;
bool force_local;
bool read_only;
- bool grow_machine_directory;
char *temp_path;
char *final_path;
@@ -47,8 +46,6 @@ struct RawImport {
ImportCompress compress;
- uint64_t written_since_last_grow;
-
sd_event_source *input_event_source;
uint8_t buffer[16*1024];
@@ -95,7 +92,6 @@ int raw_import_new(
_cleanup_(raw_import_unrefp) RawImport *i = NULL;
_cleanup_free_ char *root = NULL;
- bool grow;
int r;
assert(ret);
@@ -104,8 +100,6 @@ int raw_import_new(
if (!root)
return -ENOMEM;
- grow = path_startswith(root, "/var/lib/machines");
-
i = new(RawImport, 1);
if (!i)
return -ENOMEM;
@@ -117,7 +111,6 @@ int raw_import_new(
.userdata = userdata,
.last_percent = (unsigned) -1,
.image_root = TAKE_PTR(root),
- .grow_machine_directory = grow,
};
RATELIMIT_INIT(i->progress_rate_limit, 100 * USEC_PER_MSEC, 1);
@@ -307,11 +300,6 @@ static int raw_import_write(const void *p, size_t sz, void *userdata) {
RawImport *i = userdata;
ssize_t n;
- if (i->grow_machine_directory && i->written_since_last_grow >= GROW_INTERVAL_BYTES) {
- i->written_since_last_grow = 0;
- grow_machine_directory();
- }
-
n = sparse_write(i->output_fd, p, sz, 64);
if (n < 0)
return (int) n;
@@ -319,7 +307,6 @@ static int raw_import_write(const void *p, size_t sz, void *userdata) {
return -EIO;
i->written_uncompressed += sz;
- i->written_since_last_grow += sz;
return 0;
}