]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: Rename fs_set_error_async() to fs_file_set_error_async()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 29 Nov 2019 14:08:37 +0000 (16:08 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 11 Dec 2019 10:12:30 +0000 (10:12 +0000)
Also changed to take fs_file instead of fs parameter.

src/lib-fs/fs-api-private.h
src/lib-fs/fs-api.c
src/lib-fs/fs-test.c

index ae36713d7320c28bbe07e7366dbe5863f255427f..2881856198f65434a4e769cf202c65fd1bcfae74 100644 (file)
@@ -164,7 +164,7 @@ void fs_class_register(const struct fs *fs_class);
 
 void fs_set_error(struct fs *fs, const char *fmt, ...) ATTR_FORMAT(2, 3);
 
-void fs_set_error_async(struct fs *fs);
+void fs_file_set_error_async(struct fs_file *file);
 
 ssize_t fs_read_via_stream(struct fs_file *file, void *buf, size_t size);
 int fs_write_via_stream(struct fs_file *file, const void *data, size_t size);
index 0e0914248236b82770b8e23ae3286919c3a11fb4..a9a1dd98e4aec720c623c743b9cc61f39ad57e7e 100644 (file)
@@ -579,7 +579,7 @@ ssize_t fs_read_via_stream(struct fs_file *file, void *buf, size_t size)
        ret = i_stream_read_bytes(file->pending_read_input, &data,
                                  &data_size, size);
        if (ret == 0) {
-               fs_set_error_async(file->fs);
+               fs_file_set_error_async(file);
                return -1;
        }
        if (ret < 0 && file->pending_read_input->stream_errno != 0) {
@@ -714,7 +714,7 @@ int fs_write_via_stream(struct fs_file *file, const void *data, size_t size)
                ret = fs_write_stream_finish_async(file);
        }
        if (ret == 0) {
-               fs_set_error_async(file->fs);
+               fs_file_set_error_async(file);
                file->write_pending = TRUE;
                return -1;
        }
@@ -1012,7 +1012,7 @@ int fs_default_copy(struct fs_file *src, struct fs_file *dest)
                break;
        case OSTREAM_SEND_ISTREAM_RESULT_WAIT_INPUT:
        case OSTREAM_SEND_ISTREAM_RESULT_WAIT_OUTPUT:
-               fs_set_error_async(dest->fs);
+               fs_file_set_error_async(dest);
                return -1;
        case OSTREAM_SEND_ISTREAM_RESULT_ERROR_INPUT:
                fs_write_stream_abort_error(dest, &dest->copy_output,
@@ -1225,9 +1225,9 @@ void fs_set_error(struct fs *fs, const char *fmt, ...)
        va_end(args);
 }
 
-void fs_set_error_async(struct fs *fs)
+void fs_file_set_error_async(struct fs_file *file)
 {
-       fs_set_error(fs, "Asynchronous operation in progress");
+       fs_set_error(file->fs, "Asynchronous operation in progress");
        errno = EAGAIN;
 }
 
index 4237fb1f8342f7be2b04d346cac1bc38c525c043..7eef5fb0cb634e04ac804df105b8c617359d2db6 100644 (file)
@@ -115,7 +115,7 @@ fs_test_get_metadata(struct fs_file *_file,
        struct test_fs_file *file = (struct test_fs_file *)_file;
 
        if (file->wait_async) {
-               fs_set_error_async(_file->fs);
+               fs_file_set_error_async(_file);
                return -1;
        }
        if (file->io_failure) {
@@ -179,7 +179,7 @@ static int fs_test_write_stream_finish(struct fs_file *_file, bool success)
 
        o_stream_destroy(&_file->output);
        if (file->wait_async) {
-               fs_set_error_async(_file->fs);
+               fs_file_set_error_async(_file);
                return 0;
        }
        if (file->io_failure)
@@ -216,7 +216,7 @@ static int fs_test_exists(struct fs_file *_file)
        struct test_fs_file *file = (struct test_fs_file *)_file;
 
        if (file->wait_async) {
-               fs_set_error_async(_file->fs);
+               fs_file_set_error_async(_file);
                return -1;
        }
        if (file->io_failure) {
@@ -231,7 +231,7 @@ static int fs_test_stat(struct fs_file *_file, struct stat *st_r)
        struct test_fs_file *file = (struct test_fs_file *)_file;
 
        if (file->wait_async) {
-               fs_set_error_async(_file->fs);
+               fs_file_set_error_async(_file);
                return -1;
        }
        if (file->io_failure) {
@@ -256,7 +256,7 @@ static int fs_test_copy(struct fs_file *_src, struct fs_file *_dest)
                dest->copy_src = test_fs_file_get(_src->fs, fs_file_path(_src));
        src = dest->copy_src;
        if (dest->wait_async) {
-               fs_set_error_async(_dest->fs);
+               fs_file_set_error_async(_dest);
                return -1;
        }
        dest->copy_src = NULL;
@@ -281,7 +281,7 @@ static int fs_test_rename(struct fs_file *_src, struct fs_file *_dest)
        struct test_fs_file *dest = (struct test_fs_file *)_dest;
 
        if (src->wait_async || dest->wait_async) {
-               fs_set_error_async(_dest->fs);
+               fs_file_set_error_async(_dest);
                return -1;
        }
 
@@ -296,7 +296,7 @@ static int fs_test_delete(struct fs_file *_file)
        struct test_fs_file *file = (struct test_fs_file *)_file;
 
        if (file->wait_async) {
-               fs_set_error_async(_file->fs);
+               fs_file_set_error_async(_file);
                return -1;
        }