From: Timo Sirainen Date: Thu, 27 Jul 2023 12:02:31 +0000 (+0300) Subject: lib-fs: remove struct fs.set X-Git-Tag: 2.4.1~1417 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=75e0b60a4a30ffd31c9bbf5bdae9916b63c99398;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: remove struct fs.set Only set.enable_timing was used, and it can be in its own field. --- diff --git a/src/lib-fs/fs-api-private.h b/src/lib-fs/fs-api-private.h index d86b8e7018..6c1fc00777 100644 --- a/src/lib-fs/fs-api-private.h +++ b/src/lib-fs/fs-api-private.h @@ -93,8 +93,6 @@ struct fs { char *username, *session_id; - struct fs_settings set; - /* may be used by fs_wait_async() to do the waiting */ struct ioloop *wait_ioloop, *prev_ioloop; @@ -103,6 +101,7 @@ struct fs { struct fs_iter *iters; struct event *event; + bool enable_timing; struct fs_stats stats; ARRAY(union fs_api_module_context *) module_contexts; diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c index e57ef6693d..4fcc4e4058 100644 --- a/src/lib-fs/fs-api.c +++ b/src/lib-fs/fs-api.c @@ -47,7 +47,7 @@ fs_alloc(const struct fs *fs_class, const char *args, fs = fs_class->v.alloc(); fs->refcount = 1; - fs->set.enable_timing = set->enable_timing; + fs->enable_timing = set->enable_timing; i_array_init(&fs->module_contexts, 5); fs->event = fs_create_event(fs, event_parent); @@ -451,7 +451,7 @@ void fs_set_metadata(struct fs_file *file, const char *key, const char *value) static void fs_file_timing_start(struct fs_file *file, enum fs_op op) { - if (!file->fs->set.enable_timing) + if (!file->fs->enable_timing) return; if (file->timing_start[op].tv_sec == 0) i_gettimeofday(&file->timing_start[op]); @@ -475,7 +475,7 @@ fs_timing_end(struct stats_dist **timing, const struct timeval *start_tv) void fs_file_timing_end(struct fs_file *file, enum fs_op op) { - if (!file->fs->set.enable_timing || file->timing_start[op].tv_sec == 0) + if (!file->fs->enable_timing || file->timing_start[op].tv_sec == 0) return; fs_timing_end(&file->fs->stats.timings[op], &file->timing_start[op]); @@ -749,7 +749,7 @@ struct istream *fs_read_stream(struct fs_file *file, size_t max_buffer_size) fs_file_timing_end(file, FS_OP_READ); return input; } - if (file->fs->set.enable_timing) { + if (file->fs->enable_timing) { struct istream *input2 = i_stream_create_fs_stats(input, file); i_stream_unref(&input); @@ -1233,7 +1233,7 @@ fs_iter_init_with_event(struct fs *fs, struct event *event, (fs_get_properties(fs) & FS_PROPERTY_OBJECTIDS) != 0); fs->stats.iter_count++; - if (fs->set.enable_timing) + if (fs->enable_timing) i_gettimeofday(&now); if (fs->v.iter_init == NULL) iter = i_new(struct fs_iter, 1); diff --git a/src/lib-fs/fs-posix.c b/src/lib-fs/fs-posix.c index e262aea650..78e640833d 100644 --- a/src/lib-fs/fs-posix.c +++ b/src/lib-fs/fs-posix.c @@ -87,8 +87,6 @@ fs_posix_init(struct fs *_fs, const char *args, i_strdup(set->temp_file_prefix) : i_strdup("temp.dovecot."); fs->temp_file_prefix_len = strlen(fs->temp_file_prefix); fs->root_path = i_strdup(set->root_path); - fs->fs.set.temp_file_prefix = fs->temp_file_prefix; - fs->fs.set.root_path = fs->root_path; fs->lock_method = FS_POSIX_LOCK_METHOD_FLOCK; fs->mode = FS_DEFAULT_MODE;