From: Timo Sirainen Date: Fri, 6 Mar 2015 09:51:55 +0000 (+0200) Subject: lib-fs: Minor code cleanup: Merge read_counted & prefetch_counted into read_or_prefet... X-Git-Tag: 2.2.16.rc1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dfd8a717fe2e1c01aeddd2992bc9745ca8e0abb;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: Minor code cleanup: Merge read_counted & prefetch_counted into read_or_prefetch_counted --- diff --git a/src/lib-fs/fs-api-private.h b/src/lib-fs/fs-api-private.h index 907fe6b112..3d7a0aeebd 100644 --- a/src/lib-fs/fs-api-private.h +++ b/src/lib-fs/fs-api-private.h @@ -99,8 +99,7 @@ struct fs_file { unsigned int write_pending:1; unsigned int metadata_changed:1; - unsigned int read_counted:1; - unsigned int prefetch_counted:1; + unsigned int read_or_prefetch_counted:1; unsigned int lookup_metadata_counted:1; unsigned int stat_counted:1; }; diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c index 1fbe7d5dd7..4124c7d6d8 100644 --- a/src/lib-fs/fs-api.c +++ b/src/lib-fs/fs-api.c @@ -269,7 +269,7 @@ int fs_get_metadata(struct fs_file *file, fs_set_error(file->fs, "Metadata not supported by backend"); return -1; } - if (!file->read_counted && !file->prefetch_counted && + if (!file->read_or_prefetch_counted && !file->lookup_metadata_counted) { file->lookup_metadata_counted = TRUE; file->fs->stats.lookup_metadata_count++; @@ -341,8 +341,8 @@ bool fs_prefetch(struct fs_file *file, uoff_t length) { bool ret; - if (!file->read_counted && !file->prefetch_counted) { - file->prefetch_counted = TRUE; + if (!file->read_or_prefetch_counted) { + file->read_or_prefetch_counted = TRUE; file->fs->stats.prefetch_count++; } T_BEGIN { @@ -383,8 +383,8 @@ ssize_t fs_read(struct fs_file *file, void *buf, size_t size) { int ret; - if (!file->read_counted && !file->prefetch_counted) { - file->read_counted = TRUE; + if (!file->read_or_prefetch_counted) { + file->read_or_prefetch_counted = TRUE; file->fs->stats.read_count++; } @@ -408,8 +408,8 @@ struct istream *fs_read_stream(struct fs_file *file, size_t max_buffer_size) ssize_t ret; bool want_seekable = FALSE; - if (!file->read_counted && !file->prefetch_counted) { - file->read_counted = TRUE; + if (!file->read_or_prefetch_counted) { + file->read_or_prefetch_counted = TRUE; file->fs->stats.read_count++; } @@ -639,7 +639,7 @@ int fs_stat(struct fs_file *file, struct stat *st_r) { int ret; - if (!file->read_counted && !file->prefetch_counted && + if (!file->read_or_prefetch_counted && !file->lookup_metadata_counted && !file->stat_counted) { file->stat_counted = TRUE; file->fs->stats.stat_count++;