From: Timo Sirainen Date: Fri, 29 Nov 2019 14:08:37 +0000 (+0200) Subject: lib-fs: Rename fs_set_error_async() to fs_file_set_error_async() X-Git-Tag: 2.3.10~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5250c1e90aaad061f6534fad969a5ce6f8f13aa4;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: Rename fs_set_error_async() to fs_file_set_error_async() Also changed to take fs_file instead of fs parameter. --- diff --git a/src/lib-fs/fs-api-private.h b/src/lib-fs/fs-api-private.h index ae36713d73..2881856198 100644 --- a/src/lib-fs/fs-api-private.h +++ b/src/lib-fs/fs-api-private.h @@ -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); diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c index 0e09142482..a9a1dd98e4 100644 --- a/src/lib-fs/fs-api.c +++ b/src/lib-fs/fs-api.c @@ -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; } diff --git a/src/lib-fs/fs-test.c b/src/lib-fs/fs-test.c index 4237fb1f83..7eef5fb0cb 100644 --- a/src/lib-fs/fs-test.c +++ b/src/lib-fs/fs-test.c @@ -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; }