1. 08 Jul, 2010 6 commits
    • Per Cederqvist's avatar
      patch introduce-generation_position.patch · de22d96e
      Per Cederqvist authored
    • Per Cederqvist's avatar
      Create empty files text-store.h and text-store.c, and include them · 26d67f86
      Per Cederqvist authored
      	in the link.
      	* src/server/text-store.h: New file, currently empty.
      	* src/server/text-store.c: New file.  Include text-store.h, but do
      	not yet do anything.
      	* src/server/Makefile.am (DISKOBJS): Added text-store.c and
      	(DBCK): Added text-store.c.
    • Per Cederqvist's avatar
      Remove the reclamation field of Text_stat. · 46ec1c8b
      Per Cederqvist authored
      	* src/include/kom-types.h (Text_stat): Remove the reclamation
      	field.  It was a mistake to add it 2006-11-06.
      	* src/server/dbck-cache.c (cached_flush_text): Don't touch
      	* src/server/memory.c (copy_text_stat): Ditto.
      	(init_text_stat): Ditto.
      	* src/server/ram-output.c (foutput_text_stat_3): Ditto.
      	* src/server/ram-parse.c (fparse_text_stat_3): Ditto.
      	(fparse_text_stat_2): Ditto.
      	(fparse_text_stat_0): Ditto.
      	* src/server/simple-cache.c (cached_create_text): Ditto.
    • Per Cederqvist's avatar
      Write dbfiles atomically, renaming them once complete. · 50e88538
      Per Cederqvist authored
      Added support for renaming a datafile once it has been completely
      written, and to write it using a temporary extension.
      * src/server/ram-io.h (struct dbfile): Added fields fn,
      tmp_extension and tmp_fn.  Added documentation.
      (dbfile_open_write): New argument: tmp_extension.
      (dbfile_rename): New function.
      (dbfile_abort): New function.
      * src/server/ram-io.c (dbfile_new): Initialize fn, tmp_extension
      and tmp_fn.
      (current_fn): New static function.  Return tmp_fn if non-NULL,
      otherwise fn.
      (dbfile_delete): Free the new fields fn, tmp_extension and
      (dbfile_open_write): New argument: tmp_extension.  Store a copy of
      the supplied filename.  If tmp_extension is non-NULL, store a copy
      of it, and compute the actual file name to open as the filname
      followed by the tmp_extension.
      (fsync_dirname): New static function.
      (dbfile_rename): New function.  Rename the file from tmp_fn to the
      wanted final filename, and sync the directory.
      (dbfile_abort): New function.
      * src/server/dbck-cache.c (cache_sync_all): Pass a NULL pointer as
      tmp_extension of dbfile_open_write(), to get the old behavior.
      * src/server/simple-cache.c (pre_sync): Ditto.
    • Per Cederqvist's avatar
      Created the utility function sstrdup. · 0cb622ac
      Per Cederqvist authored
      * src/server/ram-smalloc.c, src/include/server/smalloc.h:
      (sstrdup): New function.
    • Per Cederqvist's avatar
      Check the magic cookie when opening database files. · b7c6921e
      Per Cederqvist authored
      * src/server/ram-io.c (dbfile_open_read): New argument:
      wanted_magic.  Log a message and return NULL if the file contains
      the wrong magic cookie.  All callers updated to supply "CLEAN" as
      the magic cookie.