]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: Remove fs_write_stream_abort
authorAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 19 Aug 2016 15:57:23 +0000 (18:57 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 23 Aug 2016 10:27:37 +0000 (13:27 +0300)
Do not use fs_write_stream_abort anymore, instead use
fs_write_stream_abort_error to provide upstream some
reason when it's used.

src/lib-fs/fs-api.c
src/lib-fs/fs-api.h
src/lib-fs/fs-sis.c
src/lib-fs/fs-test-async.c

index 15dc85d233dd7edad4f7f23811622d3227912ead..344bf0206f9a338b0e77025b6d3bdeda4e05d341 100644 (file)
@@ -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)
 {
index 1ef7b478a47400482cbbf92ded992e90fcd9c5ce..f4cbfc096385128ffdb1586272e9aa53f7b8e86e 100644 (file)
@@ -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
index d36daf501262b0b09f223abfdfe51b545629d667..e17aea586ac5ce04585dca6c9305d7e24e91e3fe 100644 (file)
@@ -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;
                }
        }
index 2a73a74c768df8b887ce4756fb1ac72c1cc4245d..2da75bff9cd8510f7dba9deb4e0a0f0f09359383 100644 (file)
@@ -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;
                }