From: Timo Sirainen Date: Sat, 5 Oct 2013 10:29:26 +0000 (+0300) Subject: lib-fs: Added FS_OPEN_FLAG_ASYNC_NOQUEUE X-Git-Tag: 2.2.7~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60fe2f162e61eae1c2821bf9705c7ff7987c8ade;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: Added FS_OPEN_FLAG_ASYNC_NOQUEUE --- diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c index 899d1ed172..83a7a13bac 100644 --- a/src/lib-fs/fs-api.c +++ b/src/lib-fs/fs-api.c @@ -159,6 +159,8 @@ struct fs_file *fs_file_init(struct fs *fs, const char *path, int mode_flags) struct fs_file *file; i_assert(path != NULL); + i_assert((mode_flags & FS_OPEN_FLAG_ASYNC_NOQUEUE) == 0 || + (mode_flags & FS_OPEN_FLAG_ASYNC) != 0); T_BEGIN { file = fs->v.file_init(fs, path, mode_flags & FS_OPEN_MODE_MASK, diff --git a/src/lib-fs/fs-api.h b/src/lib-fs/fs-api.h index e87b847493..8e166a3e75 100644 --- a/src/lib-fs/fs-api.h +++ b/src/lib-fs/fs-api.h @@ -54,7 +54,12 @@ enum fs_open_flags { finished and fs_read_stream() returns a nonblocking stream. */ FS_OPEN_FLAG_ASYNC = 0x20, /* fs_read_stream() must return a seekable input stream */ - FS_OPEN_FLAG_SEEKABLE = 0x40 + FS_OPEN_FLAG_SEEKABLE = 0x40, + /* Backend should handle this file's operations immediately without + any additional command queueing. The caller is assumed to be the one + doing any rate limiting if needed. This flag can only be used with + ASYNC flag, synchronous requests are never queued. */ + FS_OPEN_FLAG_ASYNC_NOQUEUE = 0x80 }; enum fs_iter_flags {