1. 15 Jul, 2010 1 commit
  2. 08 Jul, 2010 4 commits
    • 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
      	reclamation.
      	* 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.
      46ec1c8b
    • 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
      tmp_fn.
      (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.
      50e88538
    • 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.
      0cb622ac
    • 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.
      b7c6921e