diff options
Diffstat (limited to 'src/import/import-raw.c')
-rw-r--r-- | src/import/import-raw.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c index c0869ffcf9..f6ee86d625 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -34,8 +34,7 @@ struct RawImport { void *userdata; char *local; - bool force_local; - bool read_only; + ImportFlags flags; char *temp_path; char *final_path; @@ -213,13 +212,13 @@ static int raw_import_finish(RawImport *i) { (void) copy_xattr(i->input_fd, i->output_fd); } - if (i->read_only) { + if (i->flags & IMPORT_READ_ONLY) { r = import_make_read_only_fd(i->output_fd); if (r < 0) return r; } - if (i->force_local) + if (i->flags & IMPORT_FORCE) (void) rm_rf(i->final_path, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_SUBVOLUME); r = rename_noreplace(AT_FDCWD, i->temp_path, AT_FDCWD, i->final_path); @@ -386,12 +385,13 @@ static int raw_import_on_defer(sd_event_source *s, void *userdata) { return raw_import_process(i); } -int raw_import_start(RawImport *i, int fd, const char *local, bool force_local, bool read_only) { +int raw_import_start(RawImport *i, int fd, const char *local, ImportFlags flags) { int r; assert(i); assert(fd >= 0); assert(local); + assert(!(flags & ~IMPORT_FLAGS_MASK)); if (!hostname_is_valid(local, 0)) return -EINVAL; @@ -406,8 +406,8 @@ int raw_import_start(RawImport *i, int fd, const char *local, bool force_local, r = free_and_strdup(&i->local, local); if (r < 0) return r; - i->force_local = force_local; - i->read_only = read_only; + + i->flags = flags; if (fstat(fd, &i->st) < 0) return -errno; |