From: Aki Tuomi Date: Fri, 19 Aug 2016 15:57:23 +0000 (+0300) Subject: lib-fs: Remove fs_write_stream_abort X-Git-Tag: 2.3.0.rc1~3113 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d035effc27b2556393e6b26fbe1a846741cdb8e;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: Remove fs_write_stream_abort Do not use fs_write_stream_abort anymore, instead use fs_write_stream_abort_error to provide upstream some reason when it's used. --- diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c index 15dc85d233..344bf0206f 100644 --- a/src/lib-fs/fs-api.c +++ b/src/lib-fs/fs-api.c @@ -276,7 +276,8 @@ void fs_file_close(struct fs_file *file) if (file->copy_input != NULL) { i_stream_unref(&file->copy_input); - fs_write_stream_abort(file, &file->copy_output); + fs_write_stream_abort_error(file, &file->copy_output, "fs_file_close(%s)", + o_stream_get_name(file->copy_output)); } i_free_and_null(file->write_digest); if (file->fs->v.file_close != NULL) T_BEGIN { @@ -738,11 +739,6 @@ void fs_write_stream_abort_error(struct fs_file *file, struct ostream **output, va_end(args); } -void fs_write_stream_abort(struct fs_file *file, struct ostream **output) -{ - fs_write_stream_abort_error(file, output, "Write aborted"); -} - void fs_write_set_hash(struct fs_file *file, const struct hash_method *method, const void *digest) { diff --git a/src/lib-fs/fs-api.h b/src/lib-fs/fs-api.h index 1ef7b478a4..f4cbfc0963 100644 --- a/src/lib-fs/fs-api.h +++ b/src/lib-fs/fs-api.h @@ -274,7 +274,6 @@ int fs_write_stream_finish_async(struct fs_file *file); doesn't need to do it. This must not be called after fs_write_stream_finish(), i.e. it can't be used to abort a pending async write. */ -void fs_write_stream_abort(struct fs_file *file, struct ostream **output); void fs_write_stream_abort_error(struct fs_file *file, struct ostream **output, const char *error_fmt, ...) ATTR_FORMAT(3, 4); /* Set a hash to the following write. The storage can then verify that the diff --git a/src/lib-fs/fs-sis.c b/src/lib-fs/fs-sis.c index d36daf5012..e17aea586a 100644 --- a/src/lib-fs/fs-sis.c +++ b/src/lib-fs/fs-sis.c @@ -300,7 +300,9 @@ static int fs_sis_write_stream_finish(struct fs_file *_file, bool success) i_stream_is_eof(file->hash_input)) { o_stream_unref(&_file->output); if (fs_sis_try_link(file)) { - fs_write_stream_abort(_file->parent, &file->fs_output); + fs_write_stream_abort_error(_file->parent, &file->fs_output, + "fs_sis_try_link(%s) failed", + o_stream_get_name(file->fs_output)); return 1; } } diff --git a/src/lib-fs/fs-test-async.c b/src/lib-fs/fs-test-async.c index 2a73a74c76..2da75bff9c 100644 --- a/src/lib-fs/fs-test-async.c +++ b/src/lib-fs/fs-test-async.c @@ -40,7 +40,7 @@ static void test_fs_async_write(const char *test_name, struct fs *fs) test_assert(test_file->contents->used == 0); break; case 2: - fs_write_stream_abort(file, &output); + fs_write_stream_abort_error(file, &output, "test"); test_assert(test_file->contents->used == 0); break; }