commit 29a56e2dc4d5d149982917452b1c9fd419664cbf
Author: Oswald Buddenhagen <[email protected]>
Date:   Sat Nov 2 21:41:48 2013 +0100

    don't fsync after logging every TUID
    
    as we now don't actually start propagating new messages until all TUIDs
    have been generated, it's sufficient to sync just once. this makes it
    a cheap operation, so we can do it at SYNC_NORMAL level already.

 src/sync.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sync.c b/src/sync.c
index af7188e..e279b22 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -1331,8 +1331,6 @@ box_loaded( int sts, void *aux )
                                                        srec->tuid[t1] = t2 < 
26 ? t2 + 'A' : t2 < 52 ? t2 + 'a' - 26 : t2 < 62 ? t2 + '0' - 52 : t2 == 62 ? 
'+' : '/';
                                                }
                                                Fprintf( svars->jfp, "# %d %d 
%." stringify(TUIDL) "s\n", srec->uid[M], srec->uid[S], srec->tuid );
-                                               if (FSyncLevel >= 
FSYNC_THOROUGH)
-                                                       fdatasync( fileno( 
svars->jfp ) );
                                                debug( "  -> %sing message, 
TUID %." stringify(TUIDL) "s\n", str_hl[t], srec->tuid );
                                        } else {
                                                if (srec->uid[t] == -1) {
@@ -1513,6 +1511,8 @@ box_loaded( int sts, void *aux )
        }
 
        debug( "propagating new messages\n" );
+       if (FSyncLevel >= FSYNC_NORMAL)
+               fdatasync( fileno( svars->jfp ) );
        for (t = 0; t < 2; t++) {
                Fprintf( svars->jfp, "%c %d\n", "{}"[t], svars->ctx[t]->uidnext 
);
                for (tmsg = svars->ctx[1-t]->msgs; tmsg; tmsg = tmsg->next) {

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to