]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: Added FS_OPEN_FLAG_ASYNC_NOQUEUE
authorTimo Sirainen <tss@iki.fi>
Sat, 5 Oct 2013 10:29:26 +0000 (13:29 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 5 Oct 2013 10:29:26 +0000 (13:29 +0300)
src/lib-fs/fs-api.c
src/lib-fs/fs-api.h

index 899d1ed1723a07882dbf7b55e03384c8c4c20e74..83a7a13baca4503f5923a59869d5d2af5ccc9e44 100644 (file)
@@ -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,
index e87b8474930e08d3ccd89a32a3e9ccf03ac62dc0..8e166a3e7593ac3562755431e38637c110145d76 100644 (file)
@@ -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 {