Browse Source

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.
wip/maildir-uid-dupes-test
Oswald Buddenhagen 11 years ago
parent
commit
29a56e2dc4
  1. 4
      src/sync.c

4
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 ? '+' : '/'; 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 ); 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 ); debug( " -> %sing message, TUID %." stringify(TUIDL) "s\n", str_hl[t], srec->tuid );
} else { } else {
if (srec->uid[t] == -1) { if (srec->uid[t] == -1) {
@ -1513,6 +1511,8 @@ box_loaded( int sts, void *aux )
} }
debug( "propagating new messages\n" ); debug( "propagating new messages\n" );
if (FSyncLevel >= FSYNC_NORMAL)
fdatasync( fileno( svars->jfp ) );
for (t = 0; t < 2; t++) { for (t = 0; t < 2; t++) {
Fprintf( svars->jfp, "%c %d\n", "{}"[t], svars->ctx[t]->uidnext ); Fprintf( svars->jfp, "%c %d\n", "{}"[t], svars->ctx[t]->uidnext );
for (tmsg = svars->ctx[1-t]->msgs; tmsg; tmsg = tmsg->next) { for (tmsg = svars->ctx[1-t]->msgs; tmsg; tmsg = tmsg->next) {

Loading…
Cancel
Save