mail-transaction-log-append.c revision 8f430e257605b2fd2b54cdf4c2a20ef8b53cf0ba
/* first we need to truncate this latest write so that log syncing /* size will be written later once everything is in disk */ /* write failure, fallback to in-memory indexes. */ /* now that the whole transaction has been written, rewrite the first record's size so the transaction becomes visible */ /* FIXME: when we're relying on O_APPEND and someone else wrote a transaction, we'll need to wait for it to commit its transaction. if it crashes before doing that, we'll need to overwrite it with /* we're reading from a file. avoid re-reading the data that we just wrote. this is also important for some NFS clients, which for some reason sometimes can't read() this data we just wrote in the same process */ /* nothing to write here after all (e.g. all unchanged flag updates were dropped by export) */ /* FIXME: when we remove exclusive log locking, we can't rely on this. then write non-changed offset + check real offset + rewrite the new offset if other transactions weren't written in the middle */ /* there is some garbage at the end of the transaction log (eg. previous write failed). remove it so reader doesn't