Patchwork [18/34] buffered_file: don't flush on put buffer

login
register
mail settings
Submitter Juan Quintela
Date Dec. 19, 2012, 12:33 p.m.
Message ID <1355920437-29882-19-git-send-email-quintela@redhat.com>
Download mbox | patch
Permalink /patch/207348/
State New
Headers show

Comments

Juan Quintela - Dec. 19, 2012, 12:33 p.m.
We call buffered_put_buffer with iothread held, and buffered_flush() does
synchronous writes.  We only want to do the synchronous writes outside.

Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
 buffered_file.c | 6 ------
 1 file changed, 6 deletions(-)

Patch

diff --git a/buffered_file.c b/buffered_file.c
index f4f5110..2c3820c 100644
--- a/buffered_file.c
+++ b/buffered_file.c
@@ -107,12 +107,6 @@  static int buffered_put_buffer(void *opaque, const uint8_t *buf, int64_t pos, in
         buffered_append(s, buf, size);
     }

-    error = buffered_flush(s);
-    if (error < 0) {
-        DPRINTF("buffered flush error. bailing: %s\n", strerror(-error));
-        return error;
-    }
-
     return size;
 }